mirror of
https://github.com/pi-hole/web.git
synced 2025-12-24 04:38:28 +00:00
1119 Privacy - Query Page and Dom.storage
implement memory storage for functionality in case of no storage Signed-off-by: Chris Miceli <chrismiceli@outlook.com>
This commit is contained in:
@@ -229,13 +229,20 @@ function setBsSelectDefaults() {
|
||||
};
|
||||
}
|
||||
|
||||
var backupStorage = {};
|
||||
function stateSaveCallback(itemName, data) {
|
||||
localStorage.setItem(itemName, JSON.stringify(data));
|
||||
if (localStorage === null) {
|
||||
backupStorage[itemName] = JSON.stringify(data);
|
||||
} else {
|
||||
localStorage.setItem(itemName, JSON.stringify(data));
|
||||
}
|
||||
}
|
||||
|
||||
function stateLoadCallback(itemName) {
|
||||
// Receive previous state from client's local storage area
|
||||
var data = localStorage ? localStorage.getItem(itemName) : null;
|
||||
var data =
|
||||
localStorage === null ? backupStorage[itemName] || null : localStorage.getItem(itemName);
|
||||
|
||||
// Return if not available
|
||||
if (data === null) {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user