Do not save into localStorage if render is enabled

We do not really want to save anything into user's storage/cookie unless necessary
This commit is contained in:
Bobby Wibowo 2018-10-18 20:34:05 +07:00
parent cf570347e6
commit 2bdb1d7245
No known key found for this signature in database
GPG Key ID: 51C3A1E1E22D26CF
2 changed files with 4 additions and 5 deletions

View File

@ -47,10 +47,10 @@ page.doRenderSwal = function () {
}
}).then(function (value) {
if (!value) { return }
const newValue = div.querySelector('#swalRender').checked ? '1' : '0'
const newValue = div.querySelector('#swalRender').checked ? undefined : '0'
if (newValue !== localStorage.render) {
localStorage.render = newValue
swal('Success!', `Render is now ${newValue === '1' ? 'enabled' : 'disabled'}.`, 'success')
newValue ? localStorage.render = newValue : localStorage.removeItem('render')
swal('Success!', `Render is now ${newValue ? 'disabled' : 'enabled'}.`, 'success')
const element = document.querySelector('body > .render')
element.remove()
page.doRender()
@ -60,7 +60,6 @@ page.doRenderSwal = function () {
page.doRender = function () {
if (!page.renderRoot || !page.renderArray || !page.renderArray.length) { return }
if (localStorage.render === undefined) { localStorage.render = '1' }
let element
if (localStorage.render === '0') {

View File

@ -15,7 +15,7 @@
v2: Images and config files (manifest.json, browserconfig.xml, etc).
v3: CSS and JS files (libs such as bulma, lazyload, etc).
#}
{% set v1 = "6MfcbDZldp" %}
{% set v1 = "LaPhoISlpS" %}
{% set v2 = "Ii3JYKIhb0" %}
{% set v3 = "6MfcbDZldp" %}