mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-12-23 14:03:35 +00:00
Fix for NaN preferences breaking things.
This commit is contained in:
parent
1c5d0f7017
commit
f9bd43a4c3
@ -159,7 +159,8 @@ const mixin = {
|
|||||||
(value = new URLSearchParams(window.location.search).get(key)) !== null ||
|
(value = new URLSearchParams(window.location.search).get(key)) !== null ||
|
||||||
(this.testLocalStorage && (value = localStorage.getItem(key)) !== null)
|
(this.testLocalStorage && (value = localStorage.getItem(key)) !== null)
|
||||||
) {
|
) {
|
||||||
return Number(value);
|
const num = Number(value);
|
||||||
|
return isNaN(num) ? defaultVal : num;
|
||||||
} else return defaultVal;
|
} else return defaultVal;
|
||||||
},
|
},
|
||||||
getPreferenceJSON(key, defaultVal) {
|
getPreferenceJSON(key, defaultVal) {
|
||||||
|
Loading…
Reference in New Issue
Block a user