Skip to content

Commit

Permalink
feat: show whether a Home mood is selected
Browse files Browse the repository at this point in the history
  • Loading branch information
vixalien committed Feb 13, 2024
1 parent a099377 commit 6b4c10b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions parsers/browsing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ import {

export interface Mood {
name: string;
selected: boolean;
params: string;
}

Expand All @@ -70,6 +71,7 @@ export function parse_moods(results: any[]) {

moods.push({
name: j(renderer, TEXT_RUN_TEXT),
selected: j(renderer, "isSelected"),
params: j(renderer, "navigationEndpoint.browseEndpoint.params"),
});
});
Expand Down
2 changes: 1 addition & 1 deletion util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const jo = (
export const j = (json: unknown, path: string, ...others: string[]) => {
const result = jo(json, path, ...others);

if (!result) {
if (result == null) {
throw new MuseError(
ERROR_CODE.PARSING_INVALID_JSON,
`JSONPath expression "${[path, ...others]}" returned nothing`,
Expand Down

0 comments on commit 6b4c10b

Please sign in to comment.