Skip to content
This repository was archived by the owner on Aug 16, 2024. It is now read-only.

Commit 023afb9

Browse files
committed
Fetch all catalog edges at the same time
1 parent 4daddf0 commit 023afb9

1 file changed

Lines changed: 18 additions & 17 deletions

File tree

src/stores/edgeCatalog.ts

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { EdgeModel } from "~dm_types/EdgeModel";
21
import { defineStore } from "pinia";
32

43
import { api } from "~/stores/api";
4+
import { EdgeModel } from "~dm_types/EdgeModel";
55
import { ModelSteps } from "~dm_types/ModelSteps";
66
import {
77
GET__edgecreator__model,
@@ -273,28 +273,29 @@ export const edgeCatalog = defineStore("edgeCatalog", () => {
273273
v3: true,
274274
};
275275
} else if (withDetails) {
276-
const { svgChildNodes } = await loadSvgFromString(
276+
loadSvgFromString(
277277
country,
278278
magazine,
279279
issuenumber,
280280
mtime,
281281
edgeStatus === "published"
282-
);
283-
const designers = getSvgMetadata(
284-
svgChildNodes,
285-
"contributor-designer"
286-
);
287-
const photographers = getSvgMetadata(
288-
svgChildNodes,
289-
"contributor-photographer"
290-
);
282+
).then(({ svgChildNodes }) => {
283+
const designers = getSvgMetadata(
284+
svgChildNodes,
285+
"contributor-designer"
286+
);
287+
const photographers = getSvgMetadata(
288+
svgChildNodes,
289+
"contributor-photographer"
290+
);
291291

292-
newCurrentEdges[issuecode] = getEdgeFromSvg({
293-
country,
294-
magazine,
295-
issuenumber,
296-
designers,
297-
photographers,
292+
newCurrentEdges[issuecode] = getEdgeFromSvg({
293+
country,
294+
magazine,
295+
issuenumber,
296+
designers,
297+
photographers,
298+
});
298299
});
299300
} else {
300301
newCurrentEdges[issuecode] = getEdgeFromSvg({

0 commit comments

Comments
 (0)