address returned filters

This commit is contained in:
buzz-lightsnack-2007 2024-04-14 22:18:56 +08:00
parent 9f9335e248
commit 90eb60b59a

View file

@ -23,7 +23,7 @@ export default class filters {
@param {string} URL the current URL @param {string} URL the current URL
*/ */
async select(URL = window.location.href) { async select(URL = window.location.href) {
this.one = await (async () => { let SELECTED = await (async () => {
// Get the filters. // Get the filters.
let filter = await search(`filters`, URL, `URL`, false, {"cloud": -1}); let filter = await search(`filters`, URL, `URL`, false, {"cloud": -1});
@ -31,8 +31,11 @@ export default class filters {
return filter; return filter;
})(); })();
return (this.one); if ((SELECTED && SELECTED != null && (typeof SELECTED).includes(`obj`)) ? Object.keys(SELECTED) : false) {
} this.one = (Object.entries(SELECTED))[0][1];
return (this.one);
};
};
/* Update all filters or just one. /* Update all filters or just one.