fix: reenviar clics en Button, usar toasts y reactividad de grupos

Co-authored-by: aider (openrouter/openai/gpt-5) <aider@aider.chat>
webui
brobert 2 weeks ago
parent e27f23d2c0
commit fc2fa00338

@ -5,7 +5,7 @@
export let disabled: boolean = false; export let disabled: boolean = false;
</script> </script>
<button class={`btn ${variant} ${size}`} {type} {disabled}> <button class={`btn ${variant} ${size}`} {type} {disabled} on:click on:keydown on:focus on:blur {...$$restProps}>
<slot /> <slot />
</button> </button>

@ -2,7 +2,7 @@
import Card from '$lib/ui/layout/Card.svelte'; import Card from '$lib/ui/layout/Card.svelte';
import Button from '$lib/ui/atoms/Button.svelte'; import Button from '$lib/ui/atoms/Button.svelte';
import { copyToClipboard } from '$lib/utils/copy'; import { copyToClipboard } from '$lib/utils/copy';
import { toasts } from '$lib/stores/toasts'; import { success as toastSuccess, error as toastError } from '$lib/stores/toasts';
import { createEventDispatcher } from 'svelte'; import { createEventDispatcher } from 'svelte';
export let title: string; export let title: string;
@ -15,8 +15,8 @@
async function handleCopy() { async function handleCopy() {
if (!url) return; if (!url) return;
const ok = await copyToClipboard(url); const ok = await copyToClipboard(url);
if (ok) toasts.success('Enlace de calendario copiado'); if (ok) toastSuccess('Enlace de calendario copiado');
else toasts.error('No se pudo copiar el enlace'); else toastError('No se pudo copiar el enlace');
} }
function handleRotate() { function handleRotate() {

@ -39,7 +39,10 @@
aggregateUrl = body.url || null; aggregateUrl = body.url || null;
} else if (type === 'group' && groupId) { } else if (type === 'group' && groupId) {
const idx = groups.findIndex(g => g.groupId === groupId); const idx = groups.findIndex(g => g.groupId === groupId);
if (idx >= 0) groups[idx].url = body.url || null; if (idx >= 0) {
groups[idx] = { ...groups[idx], url: body.url || null };
groups = [...groups];
}
} }
success('Feed de calendario actualizado'); success('Feed de calendario actualizado');
} catch (e) { } catch (e) {

Loading…
Cancel
Save