default to empty via when none are provided
fixes joining with only a room alias
This commit is contained in:
parent
2ed2443298
commit
bdac4a11d7
1 changed files with 4 additions and 10 deletions
|
|
@ -1,4 +1,3 @@
|
|||
import "package:fast_immutable_collections/fast_immutable_collections.dart";
|
||||
import "package:material_ui/material_ui.dart";
|
||||
import "package:flutter_hooks/flutter_hooks.dart";
|
||||
import "package:hooks_riverpod/hooks_riverpod.dart";
|
||||
|
|
@ -15,6 +14,7 @@ class const JoinDialog(final WidgetRef ref, {super.key}) extends HookWidget {
|
|||
Navigator.of(context).pop();
|
||||
|
||||
final linkInfo = roomAlias.text.linkInfo;
|
||||
final via = linkInfo?.via ?? const .empty();
|
||||
final roomIdOrAlias = linkInfo?.identifier ?? roomAlias.text;
|
||||
|
||||
showDialog(
|
||||
|
|
@ -22,19 +22,13 @@ class const JoinDialog(final WidgetRef ref, {super.key}) extends HookWidget {
|
|||
builder: (context) => Consumer(
|
||||
builder: (context, ref, _) => switch (ref.watch(
|
||||
RoomSummaryController.provider(
|
||||
.new(
|
||||
roomIdOrAlias: roomIdOrAlias,
|
||||
via: linkInfo?.via ?? const IList.empty(),
|
||||
),
|
||||
.new(roomIdOrAlias: roomIdOrAlias, via: via),
|
||||
),
|
||||
)) {
|
||||
AsyncData(:final value) => RoomSummaryDialog(
|
||||
value,
|
||||
via: linkInfo?.via,
|
||||
),
|
||||
AsyncData(:final value) => RoomSummaryDialog(value, via: via),
|
||||
AsyncError _ || AsyncLoading _ => RoomSummaryDialog(
|
||||
.new(roomId: roomIdOrAlias),
|
||||
via: linkInfo?.via,
|
||||
via: via,
|
||||
),
|
||||
},
|
||||
),
|
||||
|
|
|
|||
Loading…
Reference in a new issue