fix for seizure when changing styles
This commit is contained in:
parent
8616f42978
commit
cbbeb8009f
1 changed files with 4 additions and 7 deletions
|
@ -960,12 +960,13 @@ const app = new Vue({
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async reloadStyles() {
|
async reloadStyles() {
|
||||||
document.querySelector("body").style.opacity = 0
|
|
||||||
document.querySelector("body").style.overflow = "hidden"
|
|
||||||
const styles = this.cfg.visual.styles
|
const styles = this.cfg.visual.styles
|
||||||
document.querySelectorAll(`[id*='less']`).forEach(el => {
|
document.querySelectorAll(`[id*='less']`).forEach(el => {
|
||||||
el.remove()
|
if(el.id != "less:style") {
|
||||||
|
el.remove()
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
this.chrome.appliedTheme.info = {}
|
this.chrome.appliedTheme.info = {}
|
||||||
await asyncForEach(styles, async (style) => {
|
await asyncForEach(styles, async (style) => {
|
||||||
let styleEl = document.createElement("link")
|
let styleEl = document.createElement("link")
|
||||||
|
@ -985,10 +986,6 @@ const app = new Vue({
|
||||||
less.registerStylesheetsImmediately()
|
less.registerStylesheetsImmediately()
|
||||||
less.refresh(true, true, true)
|
less.refresh(true, true, true)
|
||||||
this.$forceUpdate()
|
this.$forceUpdate()
|
||||||
setTimeout(() => {
|
|
||||||
document.querySelector("body").style.opacity = ""
|
|
||||||
document.querySelector("body").style.overflow = ""
|
|
||||||
}, 500)
|
|
||||||
},
|
},
|
||||||
macOSEmu() {
|
macOSEmu() {
|
||||||
this.chrome.forceDirectives["macosemu"] = {
|
this.chrome.forceDirectives["macosemu"] = {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue