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,
|
children,
|
||||||
selected = false,
|
selected = false,
|
||||||
}: AddExploreServerPromptProps) {
|
}: AddExploreServerPromptProps) {
|
||||||
|
const mx = useMatrixClient();
|
||||||
const [dialog, setDialog] = useState(false);
|
const [dialog, setDialog] = useState(false);
|
||||||
const serverInputRef = useRef<HTMLInputElement>(null);
|
const serverInputRef = useRef<HTMLInputElement>(null);
|
||||||
|
|
||||||
|
|
@ -70,9 +71,10 @@ export function AddExploreServerPrompt({
|
||||||
const server = getInputServer();
|
const server = getInputServer();
|
||||||
if (!server) return;
|
if (!server) return;
|
||||||
|
|
||||||
|
await mx.publicRooms({ server, limit: 1 });
|
||||||
await onSubmit(server);
|
await onSubmit(server);
|
||||||
setDialog(false);
|
setDialog(false);
|
||||||
}, [onSubmit])
|
}, [onSubmit, mx])
|
||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue