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