Merge pull request #330 from getmango/fix/subscription-manager-single-plugin

Correctly load subscriptions when there's only one plugin
This commit is contained in:
Alex Ling 2022-08-19 19:32:49 +08:00 committed by GitHub
commit 2597b4ce60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -13,12 +13,12 @@ const component = () => {
if (!data.success) throw new Error(data.error); if (!data.success) throw new Error(data.error);
this.plugins = data.plugins; this.plugins = data.plugins;
const pid = localStorage.getItem("plugin"); let pid = localStorage.getItem("plugin");
if (pid && this.plugins.map((p) => p.id).includes(pid)) if (!pid || !this.plugins.find((p) => p.id === pid)) {
this.pid = pid; pid = this.plugins[0].id;
else if (this.plugins.length > 0) }
this.pid = this.plugins[0].id;
this.pid = pid;
this.list(pid); this.list(pid);
}) })
.catch((e) => { .catch((e) => {