1
0
mirror of https://github.com/koloml/furbooru-tagging-assistant.git synced 2025-12-23 23:02:58 +00:00

Deleting profile from the profile editor page

This commit is contained in:
2024-03-23 03:17:21 +04:00
parent fdb1ed913e
commit ab617fd6b3

View File

@@ -57,6 +57,16 @@
await goto('/settings/maintenance/' + targetProfile.id);
}
async function deleteProfile() {
if (!targetProfile) {
console.warn('Attempting to delete the profile, but the profile is not loaded yet.');
return;
}
await targetProfile.delete();
await goto('/settings/maintenance');
}
onDestroy(unsubscribeFromProfiles);
</script>
@@ -77,4 +87,7 @@
<Menu>
<hr>
<MenuLink href="#" on:click={saveProfile}>Save Profile</MenuLink>
{#if profileId !== 'new'}
<MenuLink href="#" on:click={deleteProfile}>Delete Profile</MenuLink>
{/if}
</Menu>