fix(messaging): localize the messages columns

When it was global, the state (show values) would persist when switching
between different projects rather than resetting back to the default.
This commit is contained in:
Steven Nguyen
2024-02-29 20:49:10 -08:00
parent 6991e5bf32
commit 2c8acf3430
2 changed files with 11 additions and 11 deletions
@@ -34,12 +34,14 @@
import FailedModal from './failedModal.svelte';
import MessageStatusPill from './messageStatusPill.svelte';
import ProviderType from './providerType.svelte';
import { columns, showCreate } from './store';
import { showCreate } from './store';
import { sdk } from '$lib/stores/sdk';
import { invalidate } from '$app/navigation';
import { trackEvent, Submit, trackError } from '$lib/actions/analytics';
import { Dependencies } from '$lib/constants';
import { addNotification } from '$lib/stores/notifications';
import type { Column } from '$lib/helpers/types';
import { writable } from 'svelte/store';
export let data: PageData;
let selected: string[] = [];
@@ -50,6 +52,14 @@
let showCreateDropdownMobile = false;
let showCreateDropdownDesktop = false;
let showCreateDropdownEmpty = false;
const columns = writable<Column[]>([
{ id: '$id', title: 'Message ID', type: 'string', show: true, width: 140 },
{ id: 'message', title: 'Message', type: 'string', show: false, filter: false, width: 140 },
{ id: 'providerType', title: 'Type', type: 'string', show: true, width: 100 },
{ id: 'status', title: 'Status', type: 'string', show: true, width: 120 },
{ id: 'scheduledAt', title: 'Scheduled at', type: 'datetime', show: true, width: 120 },
{ id: 'deliveredAt', title: 'Delivered at', type: 'datetime', show: false, width: 120 }
]);
const project = $page.params.project;
@@ -1,17 +1,7 @@
import type { Column } from '$lib/helpers/types';
import type { Models } from '@appwrite.io/console';
import { writable } from 'svelte/store';
export const showCreate = writable(false);
export const columns = writable<Column[]>([
{ id: '$id', title: 'Message ID', type: 'string', show: true, width: 140 },
{ id: 'message', title: 'Message', type: 'string', show: false, filter: false, width: 140 },
{ id: 'providerType', title: 'Type', type: 'string', show: true, width: 100 },
{ id: 'status', title: 'Status', type: 'string', show: true, width: 120 },
{ id: 'scheduledAt', title: 'Scheduled at', type: 'datetime', show: true, width: 120 },
{ id: 'deliveredAt', title: 'Delivered at', type: 'datetime', show: false, width: 120 }
]);
export const targetsById = writable<Record<string, Models.Target>>({});
export const topicsById = writable<Record<string, Models.Topic>>({});