mirror of
https://github.com/TeamPiped/Piped.git
synced 2025-12-26 14:40:21 +00:00
Remove all direct localStorage calls.
Also: make instance changes active instantly without needing a reload.
This commit is contained in:
12
src/main.js
12
src/main.js
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user