mirror of
https://github.com/LLOneBot/LLOneBot.git
synced 2024-11-22 01:56:33 +00:00
✨ 退出设置界面时检查配置是否改动并提示用户保存配置
This commit is contained in:
parent
2a67ffae24
commit
8b04833a6a
@ -456,9 +456,11 @@ async function onSettingWindowCreated(view: Element) {
|
||||
}
|
||||
window.llonebot.checkVersion().then(checkVersionFunc)
|
||||
window.addEventListener('beforeunload', () => {
|
||||
if (JSON.stringify(ob11Config) === JSON.stringify(config.ob11)) return
|
||||
config.ob11 = ob11Config
|
||||
window.llonebot.setConfig(true, config)
|
||||
window.llonebot.getConfig().then(oldConfig=>{
|
||||
if(JSON.stringify(oldConfig) !== JSON.stringify(config)){
|
||||
window.llonebot.setConfig(true, config)
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user