This commit is contained in:
Lyz Coote
2026-02-02 21:52:13 +01:00
parent d6a5cb8a67
commit 0f71cd3e0a
30 changed files with 3949 additions and 93 deletions

View File

@@ -1,14 +1,18 @@
import { redirect } from '@sveltejs/kit';
import type { PageLoad } from './$types';
import { GetImageViewerData, GetStartupFile, ReadEML } from '$lib/wailsjs/go/main/App';
import { GetViewerData, GetStartupFile, ReadEML } from '$lib/wailsjs/go/main/App';
import DOMPurify from 'dompurify';
export const load: PageLoad = async () => {
try {
// Check if we are in viewer mode
const viewerData = await GetImageViewerData();
if (viewerData && viewerData.data) {
throw redirect(302, "/image-viewer");
const viewerData = await GetViewerData();
if (viewerData) {
if (viewerData.imageData) {
throw redirect(302, "/image");
}
if (viewerData.pdfData) {
throw redirect(302, "/pdf");
}
}
// Check if opened with a file