fix: restore fly transition on Toast, clean up debug logs
Add fly transition back to Toast component and move cleanup from onDestroy to onMount return for SSR safety. Remove debug console.logs from page orchestrator. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
<script>
|
<script>
|
||||||
import { onMount, onDestroy } from 'svelte';
|
import { onMount } from 'svelte';
|
||||||
import { fly } from 'svelte/transition';
|
import { fly } from 'svelte/transition';
|
||||||
|
|
||||||
/** @type {string} */
|
/** @type {string} */
|
||||||
@@ -40,14 +40,11 @@
|
|||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
startTimer();
|
startTimer();
|
||||||
});
|
return () => clearTimer();
|
||||||
|
|
||||||
onDestroy(() => {
|
|
||||||
clearTimer();
|
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="toast" transition:fly={{ y: 20, duration: 200 }}>
|
<div class="toast" transition:fly={{ y: 50, duration: 200 }}>
|
||||||
<span class="toast-message">{message}</span>
|
<span class="toast-message">{message}</span>
|
||||||
{#if action}
|
{#if action}
|
||||||
<button class="toast-action" on:click={handleAction} type="button">
|
<button class="toast-action" on:click={handleAction} type="button">
|
||||||
|
|||||||
@@ -148,7 +148,6 @@
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
await tasksStore.complete(uuid);
|
await tasksStore.complete(uuid);
|
||||||
// Show undo toast
|
|
||||||
undoToast = { uuid: task.uuid, description: task.description };
|
undoToast = { uuid: task.uuid, description: task.description };
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Failed to complete task:', error);
|
console.error('Failed to complete task:', error);
|
||||||
|
|||||||
Reference in New Issue
Block a user