use localStorage var

This commit is contained in:
jdcaballerov 2020-12-14 13:00:13 -05:00
parent 8fca36a7cd
commit d4255be077

View file

@ -190,12 +190,12 @@
}; };
function selectSnapshotListView(){ function selectSnapshotListView(){
myStorage.setItem('currentSnapshotView', 'List'); localStorage.setItem('currentSnapshotView', 'List');
redirectWithQuery("{% url 'admin:core_snapshot_changelist' %}"); redirectWithQuery("{% url 'admin:core_snapshot_changelist' %}");
}; };
function selectSnapshotGridView(){ function selectSnapshotGridView(){
myStorage.setItem('currentSnapshotView', 'Grid'); localStorage.setItem('currentSnapshotView', 'Grid');
redirectWithQuery("{% url 'admin:grid' %}"); redirectWithQuery("{% url 'admin:grid' %}");
}; };
@ -211,7 +211,6 @@
}; };
function setupSnapshotViews() { function setupSnapshotViews() {
myStorage = window.localStorage;
const preferredSnapshotView = localStorage.getItem('currentSnapshotView'); const preferredSnapshotView = localStorage.getItem('currentSnapshotView');
setPreferredSnapshotView(preferredSnapshotView); setPreferredSnapshotView(preferredSnapshotView);