Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
nwaughachukwuma committed Dec 6, 2024
1 parent 80ac879 commit 3c94868
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 2 additions & 2 deletions app/src/lib/components/ChatBoxAndWidget.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
import { createEventDispatcher } from 'svelte';
import ChatBoxAttachment from './ChatBoxAttachment.svelte';
import ChatBoxAttachmentPreview from './ChatBoxAttachmentPreview.svelte';
import { setAttachmentsContext } from '@/stores/attachmentsContext.svelte';
import { getAttachmentsContext } from '@/stores/attachmentsContext.svelte';
export let searchTerm = '';
const { uploadedItems$ } = setAttachmentsContext();
const { uploadedItems$ } = getAttachmentsContext();
const dispatch = createEventDispatcher<{
submitSearch: { value: string };
Expand Down
3 changes: 2 additions & 1 deletion app/src/lib/stores/attachmentsContext.svelte.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ export const setAttachmentsContext = () => {

export type AttachmentsContext = ReturnType<typeof setAttachmentsContext>;

export const getAttachmentsContext = () => getContext<AttachmentsContext>(CONTEXT_KEY);
export const getAttachmentsContext = () =>
getContext<AttachmentsContext>(CONTEXT_KEY) || setAttachmentsContext();

0 comments on commit 3c94868

Please sign in to comment.