mirror of
https://github.com/cinnyapp/cinny.git
synced 2025-11-06 07:20:29 +03:00
Ensure public rooms are fetchable before saving a server
This commit is contained in:
parent
80d322b09a
commit
96746d8976
1 changed files with 3 additions and 1 deletions
|
|
@ -55,6 +55,7 @@ export function AddExploreServerPrompt({
|
|||
children,
|
||||
selected = false,
|
||||
}: AddExploreServerPromptProps) {
|
||||
const mx = useMatrixClient();
|
||||
const [dialog, setDialog] = useState(false);
|
||||
const serverInputRef = useRef<HTMLInputElement>(null);
|
||||
|
||||
|
|
@ -70,9 +71,10 @@ export function AddExploreServerPrompt({
|
|||
const server = getInputServer();
|
||||
if (!server) return;
|
||||
|
||||
await mx.publicRooms({ server, limit: 1 });
|
||||
await onSubmit(server);
|
||||
setDialog(false);
|
||||
}, [onSubmit])
|
||||
}, [onSubmit, mx])
|
||||
);
|
||||
|
||||
return (
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue