web/safety-warning: early returns

This commit is contained in:
dumbmoron 2024-09-08 15:49:09 +00:00
parent 002e70cb89
commit b4599e68bb
No known key found for this signature in database

View File

@ -7,7 +7,10 @@ import settings, { updateSetting } from "$lib/state/settings";
import { createDialog } from "$lib/dialogs";
export const apiOverrideWarning = async () => {
if (env.DEFAULT_API && !get(settings).processing.seenOverrideWarning) {
if (!env.DEFAULT_API || get(settings).processing.seenOverrideWarning) {
return;
}
let _actions: {
resolve: () => void;
reject: () => void;
@ -58,11 +61,13 @@ export const apiOverrideWarning = async () => {
})
await promise;
}
}
export const customInstanceWarning = async () => {
if (!get(settings).processing.seenCustomWarning) {
if (get(settings).processing.seenCustomWarning) {
return;
}
let _actions: {
resolve: () => void;
reject: () => void;
@ -107,5 +112,4 @@ export const customInstanceWarning = async () => {
})
await promise;
}
}