Remove all direct localStorage calls.

Also: make instance changes active instantly without needing a reload.
This commit is contained in:
FireMasterK
2021-07-04 23:56:02 +05:30
parent ffec9d992a
commit 7a77534098
9 changed files with 30 additions and 33 deletions

View File

@@ -115,6 +115,18 @@ const mixin = {
return value;
} else return defaultVal;
},
getPreferenceNumber(key, defaultVal) {
var value;
if (
(value = this.$route.query[key]) !== undefined ||
(localStorage && (value = localStorage.getItem(key)) !== null)
) {
return Number(value);
} else return defaultVal;
},
apiUrl() {
return this.getPreferenceString("instance", "https://pipedapi.kavin.rocks");
},
},
computed: {
backgroundColor() {