From cbe3694b8155eface8582978e02273b18f81fb64 Mon Sep 17 00:00:00 2001 From: Peter De-Ath Date: Mon, 22 Jul 2024 20:43:31 +0100 Subject: [PATCH] refac: add eventConfirmationInputValue handling in Chat.svelte --- src/lib/components/chat/Chat.svelte | 3 +++ src/lib/components/common/ConfirmDialog.svelte | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/lib/components/chat/Chat.svelte b/src/lib/components/chat/Chat.svelte index da168b754..24e74e695 100644 --- a/src/lib/components/chat/Chat.svelte +++ b/src/lib/components/chat/Chat.svelte @@ -80,6 +80,7 @@ let eventConfirmationMessage = ''; let eventConfirmationInput = false; let eventConfirmationInputPlaceholder = ''; + let eventConfirmationInputValue = ''; let eventCallback = null; let showModelSelector = true; @@ -182,6 +183,7 @@ eventConfirmationTitle = data.title; eventConfirmationMessage = data.message; eventConfirmationInputPlaceholder = data.placeholder; + eventConfirmationInputValue = data?.value ?? ''; } else { console.log('Unknown message type', data); } @@ -1489,6 +1491,7 @@ message={eventConfirmationMessage} input={eventConfirmationInput} inputPlaceholder={eventConfirmationInputPlaceholder} + inputValue={eventConfirmationInputValue} on:confirm={(e) => { if (e.detail) { eventCallback(e.detail); diff --git a/src/lib/components/common/ConfirmDialog.svelte b/src/lib/components/common/ConfirmDialog.svelte index 937370436..c0ba3783c 100644 --- a/src/lib/components/common/ConfirmDialog.svelte +++ b/src/lib/components/common/ConfirmDialog.svelte @@ -15,12 +15,12 @@ export let input = false; export let inputPlaceholder = ''; + export let inputValue = ''; export let show = false; let modalElement = null; let mounted = false; - let inputValue = ''; const handleKeyDown = (event: KeyboardEvent) => { if (event.key === 'Escape') {