only attempt to get URL

If it doesn't exist, it should silently fail.
This commit is contained in:
buzz-lightsnack-2007 2024-04-23 23:45:01 +08:00
parent 5b99800c8e
commit f5cf3f09a2

View file

@ -22,7 +22,14 @@ export default class filters {
@param {string} URL the current URL
*/
async select(URL = window.location.href) {
async select(URL) {
if (!URL) {
try {
URL = window.location.href;
} catch(err) {}
};
if (URL) {
let SELECTED = await (async () => {
// Get the filters.
let filter = await search(`filters`, URL, `URL`, 0.5, {"cloud": -1});
@ -35,6 +42,7 @@ export default class filters {
this.one = (Object.entries(SELECTED))[0][1];
return (this.one);
};
}
};
/* Update all filters or just one.