fix out of range error

This commit is contained in:
Henry Hiles 2026-06-06 17:03:06 -04:00
commit 78b5abea7d
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs

View file

@ -225,8 +225,13 @@ class Sidebar extends HookConsumerWidget {
), ),
], ],
onDestinationSelected: (value) { onDestinationSelected: (value) {
final children = selectedSpace.children.addAll(
selectedSpace.subSpaces
.map((element) => element.children)
.flattened,
);
selectedRoomIdNotifier.set( selectedRoomIdNotifier.set(
selectedSpace.children[value].metadata?.id, children[value].metadata?.id, //
); );
if (!isDesktop) Navigator.of(context).pop(); if (!isDesktop) Navigator.of(context).pop();
}, },