diff --git a/webapp/src/services/date.service.ts b/webapp/src/services/date.service.ts index ebce3da..ab3b1d2 100644 --- a/webapp/src/services/date.service.ts +++ b/webapp/src/services/date.service.ts @@ -1,6 +1,3 @@ -import { PocketbaseService } from './pocketbase.service'; - -const API = PocketbaseService.getApi(); let serverTime: Date; export class DateService { @@ -40,7 +37,10 @@ export class DateService { } public static async getServerTime(): Promise { if(!serverTime || this.isOlderThanAMinute(serverTime)) { - serverTime = new Date(await (await fetch(API.baseUrl + '/api/time')).text()); + serverTime = new Date(await (await fetch( + // eslint-disable-next-line @typescript-eslint/no-explicit-any + (import.meta as any).env.MODE === 'development' ? 'http://127.0.0.1:8090/api/time' : '/api/time', + )).text()); } return serverTime; }