Refactor moduleUpdate function to move lastModuleIds check to the end

This commit is contained in:
kwaroran
2024-11-03 23:27:19 +09:00
parent bb37ee4af0
commit 76dfa5dcdf

View File

@@ -404,10 +404,6 @@ export function moduleUpdate(){
const m = getModules() const m = getModules()
const ids = m.map((m) => m.id).join('-') const ids = m.map((m) => m.id).join('-')
if(lastModuleIds !== ids){
ReloadGUIPointer.set(get(ReloadGUIPointer) + 1)
lastModuleIds = ids
}
let moduleHideIcon = false let moduleHideIcon = false
let backgroundEmbedding = '' let backgroundEmbedding = ''
@@ -428,4 +424,9 @@ export function moduleUpdate(){
moduleBackgroundEmbedding.set(backgroundEmbedding) moduleBackgroundEmbedding.set(backgroundEmbedding)
} }
HideIconStore.set(getCurrentCharacter()?.hideChatIcon || moduleHideIcon) HideIconStore.set(getCurrentCharacter()?.hideChatIcon || moduleHideIcon)
if(lastModuleIds !== ids){
ReloadGUIPointer.set(get(ReloadGUIPointer) + 1)
lastModuleIds = ids
}
} }