mirror of
https://github.com/pocket-id/pocket-id.git
synced 2026-02-04 13:21:45 +00:00
26 lines
700 B
TypeScript
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
|
|
};
|
|
};
|