Fix an error on import page when subscriptions are null.

This commit is contained in:
Kavin 2022-08-05 22:25:51 +05:30
parent 4bacca566e
commit 8e458f4a0e
No known key found for this signature in database
GPG key ID: 49451E4482CC5BCD

View file

@ -155,7 +155,7 @@ export default {
importSubscriptionsLocally(newChannels) { importSubscriptionsLocally(newChannels) {
const subscriptions = this.override const subscriptions = this.override
? [...new Set(newChannels)] ? [...new Set(newChannels)]
: [...new Set(this.getLocalSubscriptions().concat(newChannels))]; : [...new Set((this.getLocalSubscriptions() ?? []).concat(newChannels))];
// Sort for better cache hits // Sort for better cache hits
subscriptions.sort(); subscriptions.sort();
localStorage.setItem("localSubscriptions", JSON.stringify(subscriptions)); localStorage.setItem("localSubscriptions", JSON.stringify(subscriptions));