Skip to content

Commit b8dee9b

Browse files
committed
Fix unsold discs stat
1 parent 16a57f3 commit b8dee9b

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/api/customDiscs/api.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ export async function retrieveCustomDiscs(): Promise<void> {
1515
}
1616
let response = (await httpResponse.json()).result as CustomDiscsOverview;
1717

18+
itemsStore.customMusicDiscsUnsold = response.unsoldDiscs;
19+
1820
// Update custom music disc store
1921
for (const disc of response.discs) {
2022
let storeDisc = getDiscFromStore(disc.name);

src/store/items-state.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@ export interface CustomMusicDisc {
1111
maxPrice: number;
1212
averagePrice: number;
1313
latestSale?: string;
14-
};
14+
}
1515

1616
export const itemsStore = reactive({
1717
customMusicDiscs: {} as { [discName: string]: CustomMusicDisc },
1818
customMusicDiscSources: new Set<string>(),
1919
customMusicDiscVersions: new Set<string>(),
20+
customMusicDiscsUnsold: 0,
2021
customDiscsLastUpdated: new Date(0),
2122
customDiscsStatsLastUpdated: new Date(0),
2223

src/views/ItemTypeView.vue

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@ const villagerTrades = computed(() => {
5050
return itemsStore.villagerTrades.filter((t) => t.itemType?.toLocaleLowerCase() == itemType);
5151
});
5252
53-
// Specific item type data
54-
const numUndiscoveredMusicDiscs = ref(0);
55-
5653
// Name filter
5754
const nameFilter = ref("");
5855
watch(nameFilter, async (_, __) => {
@@ -276,8 +273,8 @@ function getWikiLink() {
276273
<p class="text-gray-300" v-if="itemInfo?.description">{{ itemInfo.description }}</p>
277274

278275
<!-- Specific item type info -->
279-
<p class="text-gray-300" v-if="numUndiscoveredMusicDiscs > 0">
280-
{{ numUndiscoveredMusicDiscs }} custom discs have not been sold yet (possibly undiscovered).
276+
<p class="text-gray-300" v-if="itemsStore.customMusicDiscsUnsold > 0">
277+
{{ itemsStore.customMusicDiscsUnsold }} custom discs have not been sold yet (possibly undiscovered).
281278
</p>
282279

283280
<!-- More info -->

0 commit comments

Comments
 (0)