Fixed delete_triggered not getting reset

ref #103
This commit is contained in:
2021-03-19 18:50:15 +01:00
parent 418f9c2662
commit e76e5abcf8
2 changed files with 10 additions and 5 deletions

View File

@@ -8,11 +8,11 @@
$: delete_triggered = false;
$: original_data = {};
$: editable = {};
$: modal_open = false;
$: changes_performed = !(
JSON.stringify(editable) === JSON.stringify(original_data)
);
$: save_enabled = changes_performed && isEmail(editable.email);
let modal_open = false;
const user_promise = MeService.meControllerGet().then((data) => {
data_loaded = true;
data.groups = data.groups.map((g) => g.id);
@@ -42,7 +42,7 @@
}
</script>
<ConfirmProfileDeletion bind:modal_open />
<ConfirmProfileDeletion bind:modal_open bind:delete_triggered/>
<div class="pt-12 px-4 sm:px-6 lg:px-8 lg:pt-20 bg-gray-900 pb-12">
<div class="text-center mb-8">
<h1
@@ -51,7 +51,7 @@
</h1>
</div>
</div>
{modal_open}
<div class="pt-0 pb-16 bg-gray-50 overflow-hidden lg:pt-12 lg:py-24">
<div class="max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8">
<div>
@@ -195,7 +195,9 @@
<span data-id="donor_actions_${editable.id}">
{#if delete_triggered}
<button
on:click={modal_open=true}
on:click={()=>{
modal_open = true;
}}
class="w-full justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:">{$_('confirm-deletion')}</button>
<button
on:click={() => {