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