Fix for NaN preferences breaking things.

This commit is contained in:
Kavin
2023-03-20 00:44:10 +00:00
parent 1c5d0f7017
commit f9bd43a4c3

View File

@@ -159,7 +159,8 @@ const mixin = {
(value = new URLSearchParams(window.location.search).get(key)) !== null ||
(this.testLocalStorage && (value = localStorage.getItem(key)) !== null)
) {
return Number(value);
const num = Number(value);
return isNaN(num) ? defaultVal : num;
} else return defaultVal;
},
getPreferenceJSON(key, defaultVal) {