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

@@ -8,7 +8,7 @@
const client = useConvexClient();
// Estado do filtro
const statusFilter = $state<'draft' | 'published' | 'archived' | undefined>(undefined);
let statusFilter = $state<'draft' | 'published' | 'archived' | undefined>(undefined);
// Query de templates
const templatesQuery = useQuery(api.flows.listTemplates, () =>

View File

@@ -7,7 +7,7 @@
import ActionGuard from '$lib/components/ActionGuard.svelte';
const client = useConvexClient();
const instanceId = $derived($page.params.id as Id<'flowInstances'>);
let instanceId = $derived($page.params.id as Id<'flowInstances'>);
// Query da instância com passos
const instanceQuery = useQuery(api.flows.getInstanceWithSteps, () => ({
@@ -18,7 +18,7 @@
const usuariosQuery = useQuery(api.usuarios.listar, {});
// Query de usuários por setor para atribuição
const usuariosPorSetorQuery = $state<ReturnType<
let usuariosPorSetorQuery = $state<ReturnType<
typeof useQuery<typeof api.flows.getUsuariosBySetorForAssignment>
> | null>(null);

View File

@@ -7,7 +7,7 @@
import { page } from '$app/stores';
const client = useConvexClient();
const templateId = $derived($page.params.id as Id<'flowTemplates'>);
let templateId = $derived($page.params.id as Id<'flowTemplates'>);
// Queries
const templateQuery = useQuery(api.flows.getTemplate, () => ({
@@ -36,7 +36,7 @@
// Estado do passo selecionado
let selectedStepId = $state<Id<'flowSteps'> | null>(null);
const selectedStep = $derived(localSteps?.find((s) => s._id === selectedStepId));
let selectedStep = $derived(localSteps?.find((s) => s._id === selectedStepId));
// Modal de novo passo
let showNewStepModal = $state(false);

View File

@@ -8,7 +8,7 @@
const client = useConvexClient();
// Estado dos filtros
const statusFilter = $state<'active' | 'completed' | 'cancelled' | undefined>(undefined);
let statusFilter = $state<'active' | 'completed' | 'cancelled' | undefined>(undefined);
// Query de instâncias
const instancesQuery = useQuery(api.flows.listInstances, () =>