Skip to content

Commit

Permalink
web: Fix issue code details storage after fetchIssuecodesByPublicatio…
Browse files Browse the repository at this point in the history
…ncode call
  • Loading branch information
bperel committed Nov 20, 2024
1 parent a2193a0 commit b4f4898
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
1 change: 0 additions & 1 deletion apps/edgecreator/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
<script setup lang="ts">
import Cookies from "js-cookie";
import { SocketClient } from "~socket.io-client-services/index";
import { buildWebStorage } from "~socket.io-client-services/index";
import { stores as webStores } from "~web";
import useDmSocket, {
Expand Down
11 changes: 5 additions & 6 deletions apps/web/src/components/IssueList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@

<span class="issue-text">
{{ issueNumberTextPrefix
}}{{ issuecodeDetails[issuecode].issuenumber }}
}}{{ issuecodeDetails[issuecode]?.issuenumber }}
<span class="issue-title">{{ title }}</span>
</span>
</span>
Expand Down Expand Up @@ -187,7 +187,7 @@

<span class="issue-text">
{{ issueNumberTextPrefix
}}{{ issuecodeDetails[issuecode].issuenumber }}
}}{{ issuecodeDetails[issuecode]?.issuenumber }}
<span class="issue-title">{{ title }}</span>
</span>
</span>
Expand Down Expand Up @@ -464,10 +464,9 @@ const showFilter = $computed(
);
const issueIds = $computed(() =>
Object.values(copiesBySelectedIssuecode).reduce<number[]>((acc, issues) => {
acc.concat(issues.map((issue) => issue.id));
return acc;
}, []),
Object.values(copiesBySelectedIssuecode)
.map((issues) => issues.map(({ id }) => id))
.flat(),
);
let contextMenuKey = $ref<string>("context-menu");
Expand Down
6 changes: 5 additions & 1 deletion apps/web/src/stores/coa.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import type {
inducks_storyversion,
} from "~prisma-schemas/client_coa";
import type { EventReturnType } from "~socket.io-services";
import "~group-by";

import { socketInjectionKey } from "../composables/useDmSocket";

Expand Down Expand Up @@ -241,7 +242,10 @@ export const coa = defineStore("coa", () => {
const issuesByPublicationcode =
await services.getIssuesByPublicationcodes(newPublicationcodes);

Object.assign(issuecodeDetails.value, issuesByPublicationcode);
Object.assign(
issuecodeDetails.value,
Object.values(issuesByPublicationcode).flat().groupBy("issuecode"),
);
Object.assign(
issuecodesByPublicationcode.value,
Object.entries(issuesByPublicationcode).reduce<
Expand Down

0 comments on commit b4f4898

Please sign in to comment.