1
0
mirror of https://github.com/pocket-id/pocket-id.git synced 2026-02-15 15:45:05 +00:00

feat: add env variable to disable update check

This commit is contained in:
Elias Schneider
2025-03-10 20:48:57 +01:00
parent e5ec264bfd
commit 31198feec2
4 changed files with 16 additions and 6 deletions

View File

@@ -1,12 +1,12 @@
{ {
"name": "pocket-id-frontend", "name": "pocket-id-frontend",
"version": "0.36.0", "version": "0.37.0",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "pocket-id-frontend", "name": "pocket-id-frontend",
"version": "0.36.0", "version": "0.37.0",
"dependencies": { "dependencies": {
"@simplewebauthn/browser": "^13.1.0", "@simplewebauthn/browser": "^13.1.0",
"@tailwindcss/vite": "^4.0.0", "@tailwindcss/vite": "^4.0.0",

View File

@@ -63,8 +63,8 @@ export default class AppConfigService extends APIService {
.then((res) => res.data) .then((res) => res.data)
.catch(() => null); .catch(() => null);
let newestVersion: string | null = null; let newestVersion: string | undefined;
let isUpToDate: boolean | null = null; let isUpToDate: boolean | undefined;
if (response) { if (response) {
newestVersion = response.tag_name.replace('v', ''); newestVersion = response.tag_name.replace('v', '');
isUpToDate = newestVersion === currentVersion; isUpToDate = newestVersion === currentVersion;

View File

@@ -45,7 +45,7 @@ export type AppConfigRawResponse = {
}[]; }[];
export type AppVersionInformation = { export type AppVersionInformation = {
isUpToDate: boolean | null; isUpToDate?: boolean;
newestVersion: string | null; newestVersion?: string;
currentVersion: string; currentVersion: string;
}; };

View File

@@ -1,3 +1,5 @@
import { version as currentVersion } from '$app/environment';
import { env } from '$env/dynamic/private';
import AppConfigService from '$lib/services/app-config-service'; import AppConfigService from '$lib/services/app-config-service';
import type { AppVersionInformation } from '$lib/types/application-configuration'; import type { AppVersionInformation } from '$lib/types/application-configuration';
import type { LayoutServerLoad } from './$types'; import type { LayoutServerLoad } from './$types';
@@ -6,6 +8,14 @@ let versionInformation: AppVersionInformation;
let versionInformationLastUpdated: number; let versionInformationLastUpdated: number;
export const load: LayoutServerLoad = async () => { export const load: LayoutServerLoad = async () => {
if (env.UPDATE_CHECK_DISABLED === 'true') {
return {
versionInformation: {
currentVersion: currentVersion
} satisfies AppVersionInformation
};
}
const appConfigService = new AppConfigService(); const appConfigService = new AppConfigService();
// Cache the version information for 3 hours // Cache the version information for 3 hours