Skip to content

Commit

Permalink
make join server modal code field required
Browse files Browse the repository at this point in the history
  • Loading branch information
MaddyUnderStars committed Aug 12, 2023
1 parent 7b5c4bb commit 18e8a82
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions src/components/modals/JoinServerModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,7 @@ function JoinServerModal() {
const code = data.code.split("/").reverse()[0];

app.rest
.post<never, { guild_id: string; channel_id: string }>(
Routes.invite(code),
)
.post<never, { guild_id: string; channel_id: string }>(Routes.invite(code))
.then((r) => {
navigate(`/channels/${r.guild_id}/${r.channel_id}`);
closeModal();
Expand Down Expand Up @@ -158,7 +156,7 @@ function JoinServerModal() {
)}
</LabelWrapper>
<Input
{...register("code")}
{...register("code", { required: true })}
placeholder="https://app.spacebar.chat/invite/cool-guild"
type="text"
maxLength={9999}
Expand All @@ -169,11 +167,7 @@ function JoinServerModal() {
</ModelContentContainer>

<ModalFooter>
<ModalActionItem
variant="filled"
size="med"
onClick={onSubmit}
>
<ModalActionItem variant="filled" size="med" onClick={onSubmit}>
Join Guild
</ModalActionItem>

Expand Down

0 comments on commit 18e8a82

Please sign in to comment.