feat: smart timer safety net - save dialog on stop without project
This commit is contained in:
11
src/App.vue
11
src/App.vue
@@ -15,12 +15,14 @@ import { audioEngine, DEFAULT_EVENTS } from './utils/audio'
|
||||
import type { SoundEvent } from './utils/audio'
|
||||
import TourOverlay from './components/TourOverlay.vue'
|
||||
import RecurringPromptDialog from './components/RecurringPromptDialog.vue'
|
||||
import TimerSaveDialog from './components/TimerSaveDialog.vue'
|
||||
import { useOnboardingStore } from './stores/onboarding'
|
||||
import { useProjectsStore } from './stores/projects'
|
||||
import { useInvoicesStore } from './stores/invoices'
|
||||
|
||||
const settingsStore = useSettingsStore()
|
||||
const recurringStore = useRecurringStore()
|
||||
const timerStore = useTimerStore()
|
||||
const { announcement } = useAnnouncer()
|
||||
|
||||
function getProjectName(projectId?: number): string {
|
||||
@@ -98,7 +100,6 @@ onMounted(async () => {
|
||||
const onboardingStore = useOnboardingStore()
|
||||
await onboardingStore.load()
|
||||
|
||||
const timerStore = useTimerStore()
|
||||
await timerStore.restoreState()
|
||||
|
||||
const zoom = parseInt(settingsStore.settings.ui_zoom) || 100
|
||||
@@ -275,6 +276,14 @@ watch(() => settingsStore.settings.persistent_notifications, (val) => {
|
||||
@snooze="recurringStore.snoozePrompt()"
|
||||
@skip="recurringStore.skipPrompt()"
|
||||
/>
|
||||
<TimerSaveDialog
|
||||
:show="timerStore.showSaveDialog"
|
||||
:elapsed-seconds="timerStore.pendingStopDuration"
|
||||
:mode="timerStore.saveDialogMode"
|
||||
@save="timerStore.handleSaveDialogSave"
|
||||
@discard="timerStore.handleSaveDialogDiscard"
|
||||
@cancel="timerStore.handleSaveDialogCancel"
|
||||
/>
|
||||
<div id="route-announcer" class="sr-only" aria-live="polite" aria-atomic="true"></div>
|
||||
<div id="announcer" class="sr-only" aria-live="assertive" aria-atomic="true">{{ announcement }}</div>
|
||||
<TourOverlay />
|
||||
|
||||
Reference in New Issue
Block a user