Fix edicts displaying

This commit is contained in:
natsoni 2024-10-08 12:40:25 +09:00
parent 177bbc83f3
commit e440c3f235
No known key found for this signature in database
GPG key ID: C65917583181743B

View file

@ -34,10 +34,8 @@ export class OrdDataComponent implements OnChanges {
ngOnChanges(changes: SimpleChanges): void {
if (changes.runestone && this.runestone) {
this.transferredRunes = Object.entries(this.runeInfo).map(([key, runeInfo]) => ({ key, ...runeInfo }));
if (this.runestone.mint && this.runeInfo[this.runestone.mint.toString()]) {
const mint = this.runestone.mint.toString();
this.transferredRunes = this.transferredRunes.filter(rune => rune.key !== mint);
const terms = this.runeInfo[mint].etching.terms;
const amount = terms?.amount;
const divisibility = this.runeInfo[mint].etching.divisibility;
@ -45,6 +43,12 @@ export class OrdDataComponent implements OnChanges {
this.minted = this.getAmount(amount, divisibility);
}
}
this.runestone.edicts.forEach(edict => {
if (this.runeInfo[edict.id.toString()]) {
this.transferredRunes.push({ key: edict.id.toString(), ...this.runeInfo[edict.id.toString()] });
}
});
}
if (changes.inscriptions && this.inscriptions) {