Fix mark read logic, should fix #307.

Add bot delete confirmation, closes #302.
This commit is contained in:
Paul
2021-10-10 16:28:56 +01:00
parent 26277dc0ce
commit 89c0026fa2
4 changed files with 35 additions and 18 deletions

View File

@@ -469,15 +469,20 @@ function BotCard({ bot, onDelete, onUpdate }: Props) {
<div className={styles.buttonRow}>
{editMode && (
<>
<Button accent onClick={save}>
<Button onClick={save}>
<Text id="app.special.modals.actions.save" />
</Button>
<Button
error
accent
onClick={async () => {
setSaving(true);
await client.bots.delete(bot._id);
onDelete();
openScreen({
id: "special_prompt",
type: "delete_bot",
target: bot._id,
name: user.username,
cb: onDelete,
});
}}>
<Text id="app.special.modals.actions.delete" />
</Button>