1
0
mirror of https://github.com/pocket-id/pocket-id.git synced 2026-02-04 13:21:45 +00:00
Files
pocket-id/frontend/src/routes/settings/+layout.ts
2025-10-13 09:12:55 +00:00

26 lines
700 B
TypeScript

import VersionService from '$lib/services/version-service';
import type { AppVersionInformation } from '$lib/types/application-configuration';
import type { LayoutLoad } from './$types';
export const load: LayoutLoad = async () => {
const versionService = new VersionService();
const currentVersion = versionService.getCurrentVersion();
let newestVersion = null;
let isUpToDate = true;
try {
newestVersion = await versionService.getNewestVersion();
isUpToDate = newestVersion === currentVersion;
} catch {}
const versionInformation: AppVersionInformation = {
currentVersion: versionService.getCurrentVersion(),
newestVersion,
isUpToDate
};
return {
versionInformation
};
};