mirror of
https://github.com/seerr-team/seerr.git
synced 2025-12-23 23:58:07 -05:00
* refactor: switch from Fetch API to Axios * fix: remove unwanted changes * fix: rewrite error handling for Axios and remove IPv4 first setting * style: run prettier * style: run prettier * fix: add back custom proxy agent * fix: add back custom proxy agent * fix: correct rebase issue * fix: resolve review comments
28 lines
765 B
TypeScript
28 lines
765 B
TypeScript
import type { AllSettings, NetworkSettings } from '@server/lib/settings';
|
|
import { getSettings } from '@server/lib/settings';
|
|
|
|
class RestartFlag {
|
|
private networkSettings: NetworkSettings;
|
|
|
|
public initializeSettings(settings: AllSettings): void {
|
|
this.networkSettings = {
|
|
...settings.network,
|
|
proxy: { ...settings.network.proxy },
|
|
};
|
|
}
|
|
|
|
public isSet(): boolean {
|
|
const networkSettings = getSettings().network;
|
|
|
|
return (
|
|
this.networkSettings.csrfProtection !== networkSettings.csrfProtection ||
|
|
this.networkSettings.trustProxy !== networkSettings.trustProxy ||
|
|
this.networkSettings.proxy.enabled !== networkSettings.proxy.enabled
|
|
);
|
|
}
|
|
}
|
|
|
|
const restartFlag = new RestartFlag();
|
|
|
|
export default restartFlag;
|