Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit 3b60c80

Browse files
RiotRobott3chguy
andauthored
[Backport staging] Fix create subspace dialog not working (#10656)
Co-authored-by: Michael Telatynski <[email protected]>
1 parent 8a6cf11 commit 3b60c80

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/components/views/dialogs/CreateSubspaceDialog.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,18 +56,22 @@ const CreateSubspaceDialog: React.FC<IProps> = ({ space, onAddExistingSpaceClick
5656

5757
const onCreateSubspaceClick = async (e: ButtonEvent): Promise<void> => {
5858
e.preventDefault();
59-
if (busy || !spaceNameField.current || !spaceAliasField.current) return;
59+
if (busy) return;
6060

6161
setBusy(true);
6262
// require & validate the space name field
63-
if (!(await spaceNameField.current.validate({ allowEmpty: false }))) {
63+
if (spaceNameField.current && !(await spaceNameField.current.validate({ allowEmpty: false }))) {
6464
spaceNameField.current.focus();
6565
spaceNameField.current.validate({ allowEmpty: false, focused: true });
6666
setBusy(false);
6767
return;
6868
}
6969
// validate the space name alias field but do not require it
70-
if (joinRule === JoinRule.Public && !(await spaceAliasField.current.validate({ allowEmpty: true }))) {
70+
if (
71+
spaceAliasField.current &&
72+
joinRule === JoinRule.Public &&
73+
(await spaceAliasField.current.validate({ allowEmpty: true }))
74+
) {
7175
spaceAliasField.current.focus();
7276
spaceAliasField.current.validate({ allowEmpty: true, focused: true });
7377
setBusy(false);

0 commit comments

Comments
 (0)