Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
e5b39507c8 |
|||
|
d37538b69f |
3 changed files with 15 additions and 8 deletions
|
|
@ -129,6 +129,14 @@ final class ChatScroll({
|
|||
} else if (position.extentBefore <= readThreshold) {
|
||||
await markRead();
|
||||
}
|
||||
|
||||
if (controllerData.isLoading == false &&
|
||||
position.extentBefore <= readThreshold &&
|
||||
controllerData.value?.hasMoreForward == false &&
|
||||
contextualEvent.value != null) {
|
||||
anchorId.value = null;
|
||||
contextualEvent.value = null;
|
||||
}
|
||||
}
|
||||
|
||||
scrollController.addListener(checkPosition);
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ class const ChatPage({super.key}) extends HookConsumerWidget {
|
|||
body: initComplete
|
||||
? Row(
|
||||
children: [
|
||||
if (isDesktop) Sidebar(isDesktop: isDesktop),
|
||||
if (isDesktop) Sidebar(),
|
||||
Expanded(
|
||||
child: Consumer(
|
||||
builder: (context, ref, _) {
|
||||
|
|
@ -50,9 +50,7 @@ class const ChatPage({super.key}) extends HookConsumerWidget {
|
|||
children: [Loading(), Text("Syncing...")],
|
||||
),
|
||||
),
|
||||
drawer: isDesktop || !initComplete
|
||||
? null
|
||||
: Sidebar(isDesktop: isDesktop),
|
||||
drawer: isDesktop || !initComplete ? null : Sidebar(),
|
||||
),
|
||||
);
|
||||
},
|
||||
|
|
|
|||
|
|
@ -16,8 +16,7 @@ import "package:nexus/widgets/room_menu.dart";
|
|||
// Needed for navigation_rail_m3e (#65).
|
||||
import "package:flutter/material.dart" as old_mat;
|
||||
|
||||
class const Sidebar({required final bool isDesktop, super.key})
|
||||
extends HookConsumerWidget {
|
||||
class const Sidebar({super.key}) extends HookConsumerWidget {
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final selectedSpaceProvider = KeyController.provider(
|
||||
|
|
@ -193,7 +192,8 @@ class const Sidebar({required final bool isDesktop, super.key})
|
|||
IconButton(
|
||||
tooltip: "Open notifications",
|
||||
onPressed: () {
|
||||
if (!isDesktop) Navigator.of(context).pop();
|
||||
if (Navigator.of(context).canPop())
|
||||
Navigator.of(context).pop();
|
||||
Navigator.of(context).push(
|
||||
MaterialPageRoute(
|
||||
builder: (_) => NotificationsPage(),
|
||||
|
|
@ -309,7 +309,8 @@ class const Sidebar({required final bool isDesktop, super.key})
|
|||
selectedRoomIdNotifier.set(
|
||||
children[value].metadata?.id, //
|
||||
);
|
||||
if (!isDesktop) Navigator.of(context).pop();
|
||||
if (Navigator.of(context).canPop())
|
||||
Navigator.of(context).pop();
|
||||
},
|
||||
),
|
||||
),
|
||||
|
|
|
|||
Loading…
Reference in a new issue