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:material_ui/material_ui.dart";
|
||||||
import "package:flutter_hooks/flutter_hooks.dart";
|
import "package:flutter_hooks/flutter_hooks.dart";
|
||||||
import "package:hooks_riverpod/hooks_riverpod.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();
|
Navigator.of(context).pop();
|
||||||
|
|
||||||
final linkInfo = roomAlias.text.linkInfo;
|
final linkInfo = roomAlias.text.linkInfo;
|
||||||
|
final via = linkInfo?.via ?? const .empty();
|
||||||
final roomIdOrAlias = linkInfo?.identifier ?? roomAlias.text;
|
final roomIdOrAlias = linkInfo?.identifier ?? roomAlias.text;
|
||||||
|
|
||||||
showDialog(
|
showDialog(
|
||||||
|
|
@ -22,19 +22,13 @@ class const JoinDialog(final WidgetRef ref, {super.key}) extends HookWidget {
|
||||||
builder: (context) => Consumer(
|
builder: (context) => Consumer(
|
||||||
builder: (context, ref, _) => switch (ref.watch(
|
builder: (context, ref, _) => switch (ref.watch(
|
||||||
RoomSummaryController.provider(
|
RoomSummaryController.provider(
|
||||||
.new(
|
.new(roomIdOrAlias: roomIdOrAlias, via: via),
|
||||||
roomIdOrAlias: roomIdOrAlias,
|
|
||||||
via: linkInfo?.via ?? const IList.empty(),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
)) {
|
)) {
|
||||||
AsyncData(:final value) => RoomSummaryDialog(
|
AsyncData(:final value) => RoomSummaryDialog(value, via: via),
|
||||||
value,
|
|
||||||
via: linkInfo?.via,
|
|
||||||
),
|
|
||||||
AsyncError _ || AsyncLoading _ => RoomSummaryDialog(
|
AsyncError _ || AsyncLoading _ => RoomSummaryDialog(
|
||||||
.new(roomId: roomIdOrAlias),
|
.new(roomId: roomIdOrAlias),
|
||||||
via: linkInfo?.via,
|
via: via,
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue