From 4b31004c2b9c5c855f40bfb6301282e80f555c81 Mon Sep 17 00:00:00 2001 From: Marie Date: Fri, 4 Oct 2024 08:41:23 +0200 Subject: [PATCH] upd: apply suggestions --- .../frontend/src/scripts/warning-external-website.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/frontend/src/scripts/warning-external-website.ts b/packages/frontend/src/scripts/warning-external-website.ts index c0050112ce..277656c651 100644 --- a/packages/frontend/src/scripts/warning-external-website.ts +++ b/packages/frontend/src/scripts/warning-external-website.ts @@ -21,8 +21,11 @@ export async function warningExternalWebsite(url: string) { if (r) { return new RegExp(r[1], r[2]).test(url); - } else if (expression.includes(' ')) return expression.split(' ').every(keyword => url.includes(keyword)); - else return domain.endsWith(expression); + } else if (expression.includes(' ')) { + return expression.split(' ').every(keyword => url.includes(keyword)); + } else { + return domain.endsWith(expression); + } }); const isTrustedByUser = defaultStore.reactiveState.trustedDomains.value.includes(domain); @@ -33,7 +36,7 @@ export async function warningExternalWebsite(url: string) { url, }, { done: result => { - resolve(result ? result : { canceled: true }); + resolve(result ?? { canceled: true }); }, closed: () => dispose(), });