rework store usage

This commit is contained in:
Sirttas
2026-06-11 20:02:15 +02:00
parent f3cb4798d5
commit dd031551ca
13 changed files with 46 additions and 63 deletions
+2 -2
View File
@@ -11,7 +11,7 @@ import {CharacterLabel, useCharactersStore} from "@/characters";
import {formatEveDate} from "@/formaters.ts";
const {ledgerId} = useLedgerParam();
const {findById} = useCharactersStore();
const charactersStore = useCharactersStore();
const transactions = computedAsync<TransactionResponse[]>(async () => {
if (ledgerId.value) {
@@ -21,7 +21,7 @@ const transactions = computedAsync<TransactionResponse[]>(async () => {
}, []);
const { sortedArray, headerProps } = useSort(computedAsync(() => Promise.all(transactions.value.map(async transaction => {
const character = await findById(transaction.characterId);
const character = await charactersStore.findById(transaction.characterId);
return {
character,
characterName: character?.name ?? "",
+2 -3
View File
@@ -1,15 +1,14 @@
<script setup lang="ts">
import {EditLedgerModal, Ledger, LedgerLabel, useLedgersStore} from "@/ledger";
import {storeToRefs} from "pinia";
import {nextTick, ref} from "vue";
import {PencilSquareIcon} from "@heroicons/vue/24/outline";
import {IskLabel} from "@/market";
import {SortableHeader, useSort, VirtualScrollTable} from "@/components/table";
const {ledgers} = storeToRefs(useLedgersStore());
const ledgersStore = useLedgersStore();
const { sortedArray, headerProps } = useSort<Ledger>(ledgers);
const { sortedArray, headerProps } = useSort<Ledger>(() => ledgersStore.ledgers);
const editModal = ref<typeof EditLedgerModal>();
const editingLedgerId = ref("");