From 1e807af2d417c949f9a61d49871db9b7799180e7 Mon Sep 17 00:00:00 2001 From: JonnyWong16 <9099342+JonnyWong16@users.noreply.github.com> Date: Sat, 10 Oct 2020 09:48:55 -0700 Subject: [PATCH] Fix graphs tab not saving --- data/interfaces/default/graphs.html | 5 ++--- data/interfaces/default/js/script.js | 10 ++++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/data/interfaces/default/graphs.html b/data/interfaces/default/graphs.html index 740d6a88..6de34484 100644 --- a/data/interfaces/default/graphs.html +++ b/data/interfaces/default/graphs.html @@ -347,13 +347,12 @@ current_tab = '#tabs-plays' break case '#tabs-2': - current_tab = '#tabs-strea' + current_tab = '#tabs-stream' break case '#tabs-3': current_tab = '#tabs-total' break default: - current_tab = '#tabs-plays' break } @@ -361,7 +360,7 @@ $('#yaxis-' + yaxis).closest('label').addClass('active'); $('#graph-days').val(current_day_range); $('#graph-months').val(current_month_range); - $('#nav-' + current_tab.replace('#', "")).tab('show').trigger('show.bs.tab'); + $('#nav-' + current_tab.replace('#', '')).tab('show').trigger('show.bs.tab'); //$(current_tab).addClass('active'); diff --git a/data/interfaces/default/js/script.js b/data/interfaces/default/js/script.js index 31232b76..68259f6d 100644 --- a/data/interfaces/default/js/script.js +++ b/data/interfaces/default/js/script.js @@ -591,16 +591,18 @@ function PopupCenter(url, title, w, h) { function setLocalStorage(key, value, path) { + var key_path = key; if (path !== false) { - key = key + '_' + window.location.pathname; + key_path = key_path + '_' + window.location.pathname; } - localStorage.setItem(key, value); + localStorage.setItem(key_path, value); } function getLocalStorage(key, default_value, path) { + var key_path = key; if (path !== false) { - key = key + '_' + window.location.pathname; + key_path = key_path + '_' + window.location.pathname; } - var value = localStorage.getItem(key); + var value = localStorage.getItem(key_path); if (value !== null) { return value } else if (default_value !== undefined) {