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

Commit

Permalink
Disable space fields whilst their form is busy
Browse files Browse the repository at this point in the history
  • Loading branch information
t3chguy committed May 12, 2021
1 parent 5d02e44 commit 2c89be3
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 2 additions & 0 deletions src/components/structures/SpaceRoomView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ const SpaceSetupFirstRooms = ({ space, title, description, onFinished }) => {
value={roomNames[i]}
onChange={ev => setRoomName(i, ev.target.value)}
autoFocus={i === 2}
disabled={busy}
/>;
});

Expand Down Expand Up @@ -658,6 +659,7 @@ const SpaceSetupPrivateInvite = ({ space, onFinished }) => {
ref={fieldRefs[i]}
onValidate={validateEmailRules}
autoFocus={i === 0}
disabled={busy}
/>;
});

Expand Down
6 changes: 3 additions & 3 deletions src/components/views/dialogs/SpaceSettingsDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,13 @@ const SpaceSettingsDialog: React.FC<IProps> = ({ matrixClient: cli, space, onFin

<SpaceBasicSettings
avatarUrl={avatarUrlForRoom(space, 80, 80, "crop")}
avatarDisabled={!canSetAvatar}
avatarDisabled={busy || !canSetAvatar}
setAvatar={setNewAvatar}
name={name}
nameDisabled={!canSetName}
nameDisabled={busy || !canSetName}
setName={setName}
topic={topic}
topicDisabled={!canSetTopic}
topicDisabled={busy || !canSetTopic}
setTopic={setTopic}
/>

Expand Down
4 changes: 3 additions & 1 deletion src/components/views/spaces/SpaceCreateMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ const SpaceCreateMenu = ({ onFinished }) => {
</p>

<form className="mx_SpaceBasicSettings" onSubmit={onSpaceCreateClick}>
<SpaceAvatar setAvatar={setAvatar} />
<SpaceAvatar setAvatar={setAvatar} avatarDisabled={busy} />

<Field
name="spaceName"
Expand All @@ -188,6 +188,7 @@ const SpaceCreateMenu = ({ onFinished }) => {
onChange={ev => setName(ev.target.value)}
ref={spaceNameField}
onValidate={spaceNameValidator}
disabled={busy}
/>

<Field
Expand All @@ -197,6 +198,7 @@ const SpaceCreateMenu = ({ onFinished }) => {
value={topic}
onChange={ev => setTopic(ev.target.value)}
rows={3}
disabled={busy}
/>
</form>

Expand Down

0 comments on commit 2c89be3

Please sign in to comment.