Repository navigation
fix(appstore): guard undefined store/category name labels - #274
BetterAndBetterII wants to merge 1 commit into
Conversation
Empty cateMenu (common with only a v2 third-party store) left currentCate undefined, so reading .name crashed AppPanel. Resolve labels through storeDisplayName with All/url fallbacks.
|
…s empty getCategoryList() dropped every category with a count of 0 and then took menu[0] as the current selection. With only a third-party store registered (no category-list.json, or category names that do not match its apps) the backend answers a single "All" entry with count 0, the filter empties the menu, and currentCate becomes undefined. The dropdown trigger reads currentCate.name, so the render error stopped the whole App Store panel, and getStoreList() threw on the same read so the app list never loaded either. Guard the single writer instead of every reader: categoryMenu() filters the list and falls back to a plain "All" selection when nothing is left, which sends getStoreList() down its existing "All" branch and lists the whole catalog. Idea from IceWhaleTech/CasaOS-UI#274, tracked as IceWhaleTech/CasaOS#2537; the PR's storeDisplayName helper guards readers we do not have and is not ported.
|
The bug is real and is fixed in the inkly distribution of CasaOS (UI v0.4.32, released in v0.4.41) — thanks for tracking it down. Different route to it, for what it is worth: the guard sits at If upstream never merges this, our dashboard is at https://github.com/inkly/CasaOS-UI. |




Summary
Fixes IceWhaleTech/CasaOS#2537: when only a v2-schema third-party app store is registered,
cateMenucan be empty socurrentCatebecomesundefinedandAppPanelcrashes on.name(TypeError: Cannot read properties of undefined (reading 'name')).Allsentinel whencateMenuis emptystoreDisplayName(string name, localized name object viaice_i18n, orurl/Allfallback)Test plan
store_display_name.spec.jsfor undefined/null/missing name, string name, localized name object, and url fallback