2024-10-20 20:12:27 +02:00
|
|
|
import {Cookies} from "react-cookie";
|
|
|
|
|
2024-10-20 17:54:38 +02:00
|
|
|
export default interface IFrontendSettings {
|
|
|
|
jobInterval: Date;
|
2024-10-20 20:12:27 +02:00
|
|
|
apiUri: string;
|
|
|
|
}
|
|
|
|
|
2024-10-23 02:50:26 +02:00
|
|
|
export function LoadFrontendSettings(): IFrontendSettings {
|
2024-10-20 20:12:27 +02:00
|
|
|
const cookies = new Cookies();
|
2024-10-23 02:50:26 +02:00
|
|
|
return {
|
|
|
|
jobInterval: cookies.get('jobInterval') === undefined
|
|
|
|
? new Date(0,0,0,3)
|
|
|
|
: cookies.get('jobInterval'),
|
|
|
|
apiUri: cookies.get('apiUri') === undefined
|
|
|
|
? `${window.location.protocol}//${window.location.host}/api`
|
|
|
|
: cookies.get('apiUri')
|
2024-10-20 20:12:27 +02:00
|
|
|
}
|
2024-10-20 17:54:38 +02:00
|
|
|
}
|