mirror of
https://github.com/TeamPiped/Piped.git
synced 2025-08-09 20:24:09 +00:00
Add better error messages for localStorage disabled.
This commit is contained in:
@@ -195,7 +195,7 @@ export default {
|
||||
},
|
||||
});
|
||||
} else {
|
||||
this.handleLocalSubscriptions(this.channel.id);
|
||||
if (!this.handleLocalSubscriptions(this.channel.id)) return;
|
||||
}
|
||||
this.subscribed = !this.subscribed;
|
||||
},
|
||||
|
@@ -158,7 +158,11 @@ export default {
|
||||
: [...new Set((this.getLocalSubscriptions() ?? []).concat(newChannels))];
|
||||
// Sort for better cache hits
|
||||
subscriptions.sort();
|
||||
localStorage.setItem("localSubscriptions", JSON.stringify(subscriptions));
|
||||
try {
|
||||
localStorage.setItem("localSubscriptions", JSON.stringify(subscriptions));
|
||||
} catch (e) {
|
||||
alert(this.$t("info.local_storage"));
|
||||
}
|
||||
},
|
||||
},
|
||||
};
|
||||
|
@@ -137,8 +137,8 @@ export default {
|
||||
shouldShowTrending(_this) {
|
||||
return _this.getPreferenceString("homepage", "trending") != "trending";
|
||||
},
|
||||
showSearchHistory() {
|
||||
return localStorage.getItem("searchHistory") && localStorage.getItem("search_history");
|
||||
showSearchHistory(_this) {
|
||||
return _this.getPreferenceBoolean("searchHistory", false) && localStorage.getItem("search_history");
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
|
@@ -485,7 +485,7 @@ export default {
|
||||
},
|
||||
});
|
||||
} else {
|
||||
this.handleLocalSubscriptions(this.channelId);
|
||||
if (!this.handleLocalSubscriptions(this.channelId)) return;
|
||||
}
|
||||
this.subscribed = !this.subscribed;
|
||||
},
|
||||
|
Reference in New Issue
Block a user