refactor(StorePage/index.tsx): rename variable 'result' to 'data' for clarity and consistency
refactor(StorePage/index.tsx): handle null or undefined value for 'data.results' by assigning an empty array to 'results' variable
This commit is contained in:
parent
71b3fd4245
commit
5a5b95afa5
1 changed files with 3 additions and 2 deletions
|
|
@ -70,9 +70,10 @@ export default function StorePage(): JSX.Element {
|
||||||
|
|
||||||
async function getSavedComponents() {
|
async function getSavedComponents() {
|
||||||
setLoading(true);
|
setLoading(true);
|
||||||
const result = await getStoreSavedComponents();
|
const data = await getStoreSavedComponents();
|
||||||
let savedIds = new Set<string>();
|
let savedIds = new Set<string>();
|
||||||
result.forEach((flow) => {
|
let results = data?.results ?? [];
|
||||||
|
results.forEach((flow) => {
|
||||||
savedIds.add(flow.id);
|
savedIds.add(flow.id);
|
||||||
});
|
});
|
||||||
setSavedFlows(savedIds);
|
setSavedFlows(savedIds);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue