mirror of
https://gitlab.com/soapbox-pub/mkstack.git
synced 2026-12-05 16:33:36 +00:00
filter transaction history for issued tokens and paid invoices
This commit is contained in:
1 parent
4a278d29e6
commit
3fbdf1fc60
1 file changed
+17
-1
@@ -21,7 +21,23 @@ export function useHistoryManager({
|
|||||||
try {
|
try {
|
||||||
setIsLoadingHistory(true);
|
setIsLoadingHistory(true);
|
||||||
const entries = await coco.history.getPaginatedHistory(0, 50); // TODO: show entire history
|
const entries = await coco.history.getPaginatedHistory(0, 50); // TODO: show entire history
|
||||||
setHistoryEntries(entries);
|
|
||||||
|
// Filter out unpaid quotes: only show completed transactions
|
||||||
|
// - Mint quotes: only show 'ISSUED' (completed)
|
||||||
|
// - Melt quotes: only show 'PAID' (completed)
|
||||||
|
// - Send/Receive: show all (no state field)
|
||||||
|
const filteredEntries = entries.filter((entry) => {
|
||||||
|
if (entry.type === 'mint') {
|
||||||
|
return entry.state === 'ISSUED';
|
||||||
|
}
|
||||||
|
if (entry.type === 'melt') {
|
||||||
|
return entry.state === 'PAID';
|
||||||
|
}
|
||||||
|
// Send and receive entries don't have a state field, show all
|
||||||
|
return true;
|
||||||
|
});
|
||||||
|
|
||||||
|
setHistoryEntries(filteredEntries);
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
console.error('Failed to load history:', err);
|
console.error('Failed to load history:', err);
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
Reference in new issue
Block a user