mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-06 08:38:37 +00:00
chore: fix build errors
This commit is contained in:
@@ -168,10 +168,11 @@ export const SpecialPromptModal = observer((props: SpecialProps) => {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
onClose();
|
return true;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
setError(takeError(err));
|
setError(takeError(err));
|
||||||
setProcessing(false);
|
setProcessing(false);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -210,10 +211,11 @@ export const SpecialPromptModal = observer((props: SpecialProps) => {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
props.target.delete();
|
props.target.delete();
|
||||||
onClose();
|
return true;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
setError(takeError(err));
|
setError(takeError(err));
|
||||||
setProcessing(false);
|
setProcessing(false);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -316,10 +318,11 @@ export const SpecialPromptModal = observer((props: SpecialProps) => {
|
|||||||
})
|
})
|
||||||
?.kick();
|
?.kick();
|
||||||
|
|
||||||
onClose();
|
return true;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
setError(takeError(err));
|
setError(takeError(err));
|
||||||
setProcessing(false);
|
setProcessing(false);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -366,10 +369,12 @@ export const SpecialPromptModal = observer((props: SpecialProps) => {
|
|||||||
await props.target.banUser(props.user._id, {
|
await props.target.banUser(props.user._id, {
|
||||||
reason,
|
reason,
|
||||||
});
|
});
|
||||||
onClose();
|
|
||||||
|
return true;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
setError(takeError(err));
|
setError(takeError(err));
|
||||||
setProcessing(false);
|
setProcessing(false);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -438,10 +443,11 @@ export const SpecialPromptModal = observer((props: SpecialProps) => {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
onClose();
|
return true;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
setError(takeError(err));
|
setError(takeError(err));
|
||||||
setProcessing(false);
|
setProcessing(false);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@@ -512,11 +518,13 @@ export const SpecialPromptModal = observer((props: SpecialProps) => {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
});
|
});
|
||||||
onClose();
|
|
||||||
setProcessing(false);
|
setProcessing(false);
|
||||||
|
return true;
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
setError(takeError(err));
|
setError(takeError(err));
|
||||||
setProcessing(false);
|
setProcessing(false);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -29,7 +29,6 @@ export function CreateBotModal({ onClose, onCreate }: Props) {
|
|||||||
try {
|
try {
|
||||||
const { bot } = await client.bots.create({ name });
|
const { bot } = await client.bots.create({ name });
|
||||||
onCreate(bot);
|
onCreate(bot);
|
||||||
onClose();
|
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
setError(takeError(err));
|
setError(takeError(err));
|
||||||
}
|
}
|
||||||
@@ -43,7 +42,10 @@ export function CreateBotModal({ onClose, onCreate }: Props) {
|
|||||||
{
|
{
|
||||||
confirmation: true,
|
confirmation: true,
|
||||||
palette: "accent",
|
palette: "accent",
|
||||||
onClick: handleSubmit(onSubmit),
|
onClick: async () => {
|
||||||
|
await handleSubmit(onSubmit);
|
||||||
|
return true;
|
||||||
|
},
|
||||||
children: <Text id="app.special.modals.actions.create" />,
|
children: <Text id="app.special.modals.actions.create" />,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -74,7 +74,10 @@ export function ModifyAccountModal({ onClose, field }: Props) {
|
|||||||
actions={[
|
actions={[
|
||||||
{
|
{
|
||||||
confirmation: true,
|
confirmation: true,
|
||||||
onClick: handleSubmit(onSubmit),
|
onClick: async () => {
|
||||||
|
await handleSubmit(onSubmit);
|
||||||
|
return true;
|
||||||
|
},
|
||||||
children:
|
children:
|
||||||
field === "email" ? (
|
field === "email" ? (
|
||||||
<Text id="app.special.modals.actions.send_email" />
|
<Text id="app.special.modals.actions.send_email" />
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ export function UserPicker(props: Props) {
|
|||||||
actions={[
|
actions={[
|
||||||
{
|
{
|
||||||
children: <Text id="app.special.modals.actions.ok" />,
|
children: <Text id="app.special.modals.actions.ok" />,
|
||||||
onClick: () => props.callback(selected).then(props.onClose),
|
onClick: () => props.callback(selected).then(() => true),
|
||||||
},
|
},
|
||||||
]}>
|
]}>
|
||||||
<div className={styles.list}>
|
<div className={styles.list}>
|
||||||
|
|||||||
@@ -278,7 +278,7 @@ export default observer(() => {
|
|||||||
</a>
|
</a>
|
||||||
<LineDivider />
|
<LineDivider />
|
||||||
<ButtonItem
|
<ButtonItem
|
||||||
onClick={logout}
|
onClick={() => logout()}
|
||||||
className={styles.logOut}
|
className={styles.logOut}
|
||||||
compact>
|
compact>
|
||||||
<LogOut size={20} />
|
<LogOut size={20} />
|
||||||
|
|||||||
2
src/types/revolt-api.d.ts
vendored
2
src/types/revolt-api.d.ts
vendored
@@ -1,6 +1,6 @@
|
|||||||
// TODO: re-export from revolt-api in some way
|
// TODO: re-export from revolt-api in some way
|
||||||
declare type Session = {
|
declare type Session = {
|
||||||
_id: string;
|
_id?: string;
|
||||||
token: string;
|
token: string;
|
||||||
name: string;
|
name: string;
|
||||||
user_id: string;
|
user_id: string;
|
||||||
|
|||||||
Reference in New Issue
Block a user