fix: chord conflict shows "undefined"

This commit is contained in:
2024-04-26 17:12:59 +02:00
parent 0500a723de
commit 587375e654
6 changed files with 11 additions and 9 deletions

View File

@@ -1,12 +1,15 @@
<script lang="ts">
import { createEventDispatcher } from "svelte";
import Dialog from "$lib/dialogs/Dialog.svelte";
import ActionString from "$lib/components/ActionString.svelte";
export let title: string;
export let message: string | undefined;
export let abortTitle: string;
export let confirmTitle: string;
export let actions: number[] = [];
const dispatch = createEventDispatcher();
</script>
@@ -15,6 +18,7 @@
{#if message}
<p>{@html message}</p>
{/if}
<p><ActionString {actions} /></p>
<div class="buttons">
<button on:click={() => dispatch("abort")}>{abortTitle}</button>
<button class="primary" on:click={() => dispatch("confirm")}

View File

@@ -5,6 +5,7 @@ export async function askForConfirmation(
message: string,
confirmTitle: string,
abortTitle: string,
actions: number[],
): Promise<boolean> {
const dialog = new ConfirmDialog({
target: document.body,
@@ -13,6 +14,7 @@ export async function askForConfirmation(
message,
confirmTitle,
abortTitle,
actions,
},
});