mirror of
https://github.com/Sped0n/bridget.git
synced 2026-04-22 14:09:30 -07:00
refactor(main.ts): improve code readability by adding conditional check for ijs length before initializing stage or collection
fix(resources.ts): handle case when imagesJson element is not found to prevent error and return empty array
This commit is contained in:
@@ -16,10 +16,12 @@ initState(ijs.length)
|
||||
|
||||
initNav()
|
||||
|
||||
if (!isMobile()) {
|
||||
initStage(ijs)
|
||||
initStageNav()
|
||||
} else {
|
||||
initCollection(ijs)
|
||||
initGallery(ijs)
|
||||
if (ijs.length > 0) {
|
||||
if (!isMobile()) {
|
||||
initStage(ijs)
|
||||
initStageNav()
|
||||
} else {
|
||||
initCollection(ijs)
|
||||
initGallery(ijs)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user