mirror of
https://codeberg.org/yeentown/barkey
synced 2024-11-25 18:45:13 +00:00
upd: apply suggestions
This commit is contained in:
parent
323c075483
commit
4b31004c2b
1 changed files with 6 additions and 3 deletions
|
@ -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(),
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue