Skip to content

Commit

Permalink
fix currentFile imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Ell1ott committed Feb 28, 2024
1 parent 0823ddd commit d173035
Show file tree
Hide file tree
Showing 7 changed files with 7 additions and 16 deletions.
5 changes: 0 additions & 5 deletions src/routes/store.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import { Assignment, type FileInfo } from '@/api/apiStore';
import { writable } from 'svelte/store';

export const themeVariant = writable(localStorage.getItem('themeVariant') || 'light');

themeVariant.subscribe((value) => {
localStorage.setItem('themeVariant', value);
});

export const currentFile = writable<FileInfo | null>(null);

currentFile.set(new Assignment({}));
5 changes: 2 additions & 3 deletions src/routes/workspace/FileViewer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
import { getContext, setContext } from 'svelte';
import SideBarElem from './SideBarElem.svelte';
import randomName from '$lib/randomName';
import { documentStore, type FileInfo } from '@/api/apiStore';
import { currentFile } from '../store';
import { DocumentInfo, currentFile, documentStore } from '@/api/apiStore';
const api = getContext('api') as ApiHandler;
export let files: FileInfo[] = $documentStore;
export let files: DocumentInfo[] = $documentStore;
$: files = $documentStore;
</script>
Expand Down
2 changes: 1 addition & 1 deletion src/routes/workspace/editor/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
import Toolbar from './Toolbar/Toolbar.svelte';
import FileEditor from './FileEditor.svelte';
import Workspace from '../Workspace.svelte';
import { currentFile } from '../../store';
import { getContext } from 'svelte';
import ApiHandler from '@/api';
import type { Readable } from 'svelte/store';
import type { AuthorizerState } from 'akademia-authorizer-svelte/types';
import type { Editor } from 'svelte-tiptap';
import { goto } from '$app/navigation';
import { currentFile } from '@/api/apiStore';
let editor: Readable<Editor>;
const api = new ApiHandler(<Readable<AuthorizerState>>getContext('authorizerContext'));
Expand Down
3 changes: 1 addition & 2 deletions src/routes/workspace/editor/Toolbar/MoreActions.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@
import * as Dialog from '$lib/components/ui/dialog';
import Button from '@/components/ui/button/button.svelte';
import { MoreHorizontal, Trash2, LogOut, Download, Printer } from 'lucide-svelte';
import { currentFile } from '../../../store';
import { getContext } from 'svelte';
import type ApiHandler from '@/api';
import { documentStore } from '@/api/apiStore';
import { currentFile, documentStore } from '@/api/apiStore';
import { printUsingWindow } from '@/utils/printer';
let isDeleteOpen = false;
Expand Down
3 changes: 1 addition & 2 deletions src/routes/workspace/editor/Toolbar/ShareDocument.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@
import { Separator } from '$lib/components/ui/separator';
import { getContext, onMount } from 'svelte';
import type ApiHandler from '@/api';
import { currentFile } from '../../../store';
import type { FileInfo } from '@/api/apiStore';
import type { FileInfo, currentFile } from '@/api/apiStore';
const api = getContext('api') as ApiHandler;
Expand Down
2 changes: 1 addition & 1 deletion src/routes/workspace/home/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import ActiveFiles from './activeFiles/ActiveFiles.svelte';
import Workspace from './../Workspace.svelte';
import Calendar from './Calendar/Calendar.svelte';
import { currentFile } from '../../store';
import { currentFile } from '@/api/apiStore';
currentFile.set(null);
</script>
Expand Down
3 changes: 1 addition & 2 deletions src/routes/workspace/quickActions/SearchQ.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,12 @@
import { getContext, setContext, tick } from 'svelte';
import { expoOut, quadIn, quadInOut, quadOut, sineInOut, sineOut } from 'svelte/easing';
import * as Command from '$lib/components/ui/command';
import { documentStore, type FileInfo } from '@/api/apiStore';
import { currentFile, documentStore, type FileInfo } from '@/api/apiStore';
import { goto } from '$app/navigation';
import { BookPlus, File, FilePen, FilePlus2, NotebookPen, Plus } from 'lucide-svelte';
import { CalendarPlus } from 'lucide-svelte';
import type ApiHandler from '@/api';
import randomName from '@/randomName';
import { currentFile } from '../../store';
let isSeaching = false;
const api = getContext('api') as ApiHandler;
Expand Down

0 comments on commit d173035

Please sign in to comment.