mirror of
https://github.com/easydiffusion/easydiffusion.git
synced 2024-11-25 01:34:38 +01:00
Persist audio toggle setting
This commit is contained in:
parent
5542b5e9a6
commit
8e2074d29d
16
index.html
16
index.html
@ -69,10 +69,20 @@
|
||||
</body>
|
||||
|
||||
<script>
|
||||
const SOUND_ENABLED_KEY = "soundEnabled"
|
||||
document.querySelector('#sound_toggle').checked = isSoundEnabled();
|
||||
|
||||
const HEALTH_PING_INTERVAL = 5 // seconds
|
||||
|
||||
let serverStatus = 'offline'
|
||||
|
||||
function isSoundEnabled() {
|
||||
if (localStorage.getItem(SOUND_ENABLED_KEY) === 'false') {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
function setStatus(statusType, msg, msgType) {
|
||||
let el = ''
|
||||
|
||||
@ -230,6 +240,12 @@ async function makeImage() {
|
||||
}
|
||||
}
|
||||
|
||||
function handleAudioEnabledChange(e) {
|
||||
localStorage.setItem(SOUND_ENABLED_KEY, e.target.checked.toString())
|
||||
}
|
||||
|
||||
document.querySelector('#sound_toggle').addEventListener('click', handleAudioEnabledChange)
|
||||
|
||||
document.querySelector('#makeImage').addEventListener('click', makeImage)
|
||||
|
||||
let config = document.querySelector('#config')
|
||||
|
Loading…
Reference in New Issue
Block a user