Skip to content

Commit

Permalink
Fix up json call
Browse files Browse the repository at this point in the history
  • Loading branch information
TrainDoctor committed Oct 13, 2024
1 parent 67a0b25 commit fec1700
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions frontend/src/store.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,16 +109,18 @@ export async function getPluginList(
headers: {
'X-Decky-Version': version.current,
},
}).then((r) => {
let res = JSON.parse(JSON.stringify(r.json()));
}).then(async (r) => {
let res = structuredClone(await r.json());
const lng = navigator.language;
if (res.hasOwnProperty('name-' + lng)) {
res.name = res['name-' + lng];
for (let val of res) {
if (val.hasOwnProperty('name-' + lng)) {
val.name = val['name-' + lng];
}
if (val.hasOwnProperty('description-' + lng)) {
val.description = val['description-' + lng];
}
return val;
}
if (res.hasOwnProperty('description-' + lng)) {
res.description = res['description-' + lng];
}
return res;
});
}

Expand Down

0 comments on commit fec1700

Please sign in to comment.