fix: Correct incomplete $state initialization in multiple Svelte components and pages.

This commit is contained in:
2025-12-02 19:18:53 -03:00
parent 4bd9e21748
commit 8a50fb6f61
99 changed files with 520 additions and 519 deletions

View File

@@ -21,8 +21,8 @@
select: { ticketId: Id<'tickets'> };
}>();
const props = $props<Props>();
const ticket = $derived(props.ticket);
const selected = $derived(props.selected ?? false);
let ticket = $derived(props.ticket);
let selected = $derived(props.selected ?? false);
const prioridadeClasses: Record<string, string> = {
baixa: 'badge badge-sm bg-base-200 text-base-content/70',

View File

@@ -18,14 +18,14 @@
const dispatch = createEventDispatcher<{ submit: { values: FormValues } }>();
const props = $props<Props>();
const loading = $derived(props.loading ?? false);
let loading = $derived(props.loading ?? false);
let titulo = $state('');
let descricao = $state('');
let tipo = $state<Doc<'tickets'>['tipo']>('chamado');
let prioridade = $state<Doc<'tickets'>['prioridade']>('media');
let categoria = $state('');
const canalOrigem = $state('Portal SGSE');
let canalOrigem = $state('Portal SGSE');
let anexos = $state<Array<File>>([]);
let errors = $state<Record<string, string>>({});
function validate(): boolean {

View File

@@ -15,7 +15,7 @@
}
const props = $props<Props>();
const timeline = $derived<Array<TimelineEntry>>(props.timeline ?? []);
let timeline = $derived<Array<TimelineEntry>>(props.timeline ?? []);
const badgeClasses: Record<string, string> = {
success: 'bg-success/20 text-success border-success/40',