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"; import { createDialog } from "$lib/dialogs";
export const apiOverrideWarning = async () => { export const apiOverrideWarning = async () => {
if (env.DEFAULT_API && !get(settings).processing.seenOverrideWarning) { if (!env.DEFAULT_API || get(settings).processing.seenOverrideWarning) {
return;
}
let _actions: { let _actions: {
resolve: () => void; resolve: () => void;
reject: () => void; reject: () => void;
@ -59,10 +62,12 @@ export const apiOverrideWarning = async () => {
await promise; await promise;
} }
}
export const customInstanceWarning = async () => { export const customInstanceWarning = async () => {
if (!get(settings).processing.seenCustomWarning) { if (get(settings).processing.seenCustomWarning) {
return;
}
let _actions: { let _actions: {
resolve: () => void; resolve: () => void;
reject: () => void; reject: () => void;
@ -108,4 +113,3 @@ export const customInstanceWarning = async () => {
await promise; await promise;
} }
}