web/safety-warning: early returns

This commit is contained in:
dumbmoron
2024-09-08 15:49:09 +00:00
parent 002e70cb89
commit b4599e68bb

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;
@@ -59,10 +62,12 @@ 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;
@@ -108,4 +113,3 @@ export const customInstanceWarning = async () => {
await promise;
}
}