Frontend: Composables useConfirm/useChat/usePolling; Guide-Chat abbrechbar
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
<script setup>
|
||||
import { ref, computed } from 'vue'
|
||||
import { useConfirm } from '../composables/useConfirm.js'
|
||||
|
||||
const props = defineProps({
|
||||
topics: { type: Array, required: true },
|
||||
@@ -63,21 +64,7 @@ const activeGenerations = computed(() => {
|
||||
return [...bausteinLines, ...guideLines]
|
||||
})
|
||||
|
||||
// Inline-Bestätigung statt confirm(): erster Klick scharfschalten („Sicher?"),
|
||||
// zweiter Klick führt aus. Browser-Dialoge können unterdrückt sein (Firefox).
|
||||
const pendingConfirm = ref(null)
|
||||
let confirmTimer = null
|
||||
|
||||
function armOrRun(key, action) {
|
||||
clearTimeout(confirmTimer)
|
||||
if (pendingConfirm.value === key) {
|
||||
pendingConfirm.value = null
|
||||
action()
|
||||
} else {
|
||||
pendingConfirm.value = key
|
||||
confirmTimer = setTimeout(() => { pendingConfirm.value = null }, 3000)
|
||||
}
|
||||
}
|
||||
const { pending: pendingConfirm, armOrRun } = useConfirm()
|
||||
|
||||
function confirmCancelBausteine() {
|
||||
armOrRun('bausteine', () => emit('cancelBausteine'))
|
||||
|
||||
Reference in New Issue
Block a user