refactor(transcription): replace window.confirm with ConfirmService in TranscriptionBlock
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,10 @@
|
||||
<script lang="ts">
|
||||
import { m } from '$lib/paraglide/messages.js';
|
||||
import { getConfirmService } from '$lib/services/confirm.svelte.js';
|
||||
import CommentThread from './CommentThread.svelte';
|
||||
|
||||
const { confirm } = getConfirmService();
|
||||
|
||||
type SaveState = 'idle' | 'saving' | 'saved' | 'fading' | 'error';
|
||||
|
||||
type Props = {
|
||||
@@ -90,10 +93,12 @@ function handleInput(event: Event) {
|
||||
onTextChange(target.value);
|
||||
}
|
||||
|
||||
function handleDelete() {
|
||||
if (confirm(m.transcription_block_delete_confirm())) {
|
||||
onDeleteClick();
|
||||
}
|
||||
async function handleDelete() {
|
||||
const confirmed = await confirm({
|
||||
title: m.transcription_block_delete_confirm(),
|
||||
destructive: true
|
||||
});
|
||||
if (confirmed) onDeleteClick();
|
||||
}
|
||||
|
||||
function handleTextareaMouseUp() {
|
||||
|
||||
Reference in New Issue
Block a user