working jumps from notif page

Doesn't work from notif page pushed from notif controller
This commit is contained in:
Henry Hiles 2026-09-26 19:13:30 -04:00
commit c90a1c41b0
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs
6 changed files with 136 additions and 57 deletions

View file

@ -68,6 +68,14 @@ final class ChatScroll({
if (found || controllerData is AsyncError) {
if (found) {
anchorId.value = target;
WidgetsBinding.instance.addPostFrameCallback((_) {
final context = keyFor(target).currentContext;
if (context != null && context.mounted) {
anchorMountedCompleter.value?.complete(context);
anchorMountedCompleter.value = null;
}
});
} else {
anchorMountedCompleter.value?.completeError(
StateError("Failed to load context for $target"),
@ -80,21 +88,6 @@ final class ChatScroll({
return null;
}, [controllerData, pendingAnchorTarget.value]);
useEffect(() {
final completer = anchorMountedCompleter.value;
if (completer == null) return null;
WidgetsBinding.instance.addPostFrameCallback((_) {
final context = keyFor(anchorId.value!).currentContext;
if (context != null && context.mounted) {
anchorMountedCompleter.value?.complete(context);
anchorMountedCompleter.value = null;
}
});
return null;
}, [anchorId.value]);
final ({IList<Event> history, IList<Event> live}) split = useMemoized(() {
final items = controllerData.value?.timeline;
final anchor = anchorId.value;