refactor(state.ts): extract logic to get threshold session index into a separate function for reusability and clarity

This commit is contained in:
Sped0n
2023-11-04 19:36:19 +08:00
parent 90aa1ad480
commit b9dc117fd8
3 changed files with 25 additions and 8 deletions

View File

@@ -14,9 +14,19 @@ initNav()
if (ijs.length > 0) {
if (!isMobile()) {
import('./desktop/init')
.then((d) => d.initDesktop(ijs))
.catch((e) => console.log(e))
.then((d) => {
d.initDesktop(ijs)
})
.catch((e) => {
console.log(e)
})
} else {
import('./mobile/init').then((m) => m.initMobile(ijs)).catch((e) => console.log(e))
import('./mobile/init')
.then((m) => {
m.initMobile(ijs)
})
.catch((e) => {
console.log(e)
})
}
}