Skip to content

Commit

Permalink
Merge pull request #330 from getmango/fix/subscription-manager-single…
Browse files Browse the repository at this point in the history
…-plugin

Correctly load subscriptions when there's only one plugin
  • Loading branch information
hkalexling authored Aug 19, 2022
2 parents e4af194 + cd3ee07 commit 2597b4c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions public/js/subscription-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ const component = () => {
if (!data.success) throw new Error(data.error);
this.plugins = data.plugins;

const pid = localStorage.getItem("plugin");
if (pid && this.plugins.map((p) => p.id).includes(pid))
this.pid = pid;
else if (this.plugins.length > 0)
this.pid = this.plugins[0].id;
let pid = localStorage.getItem("plugin");
if (!pid || !this.plugins.find((p) => p.id === pid)) {
pid = this.plugins[0].id;
}

this.pid = pid;
this.list(pid);
})
.catch((e) => {
Expand Down

0 comments on commit 2597b4c

Please sign in to comment.