mirror of
https://github.com/quantum5/correcthorsebatterystaple.git
synced 2025-07-27 20:04:08 -04:00
Load settings earlier to avoid race condition
This commit is contained in:
parent
ab7e4d0138
commit
6b540a940e
18
src/ui.js
18
src/ui.js
|
@ -62,6 +62,15 @@ $(() => {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const settings = window.localStorage.getItem('settings')
|
||||||
|
if (settings) {
|
||||||
|
try {
|
||||||
|
loadSettings(JSON.parse(settings))
|
||||||
|
} catch (e) {
|
||||||
|
console.log(e)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (window.crypto && window.crypto.getRandomValues) {
|
if (window.crypto && window.crypto.getRandomValues) {
|
||||||
$('#too-old').hide()
|
$('#too-old').hide()
|
||||||
|
|
||||||
|
@ -84,13 +93,4 @@ $(() => {
|
||||||
updateBitMeter()
|
updateBitMeter()
|
||||||
generatePassword()
|
generatePassword()
|
||||||
}
|
}
|
||||||
|
|
||||||
const settings = window.localStorage.getItem('settings')
|
|
||||||
if (settings) {
|
|
||||||
try {
|
|
||||||
loadSettings(JSON.parse(settings))
|
|
||||||
} catch (e) {
|
|
||||||
console.log(e)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue