Skip to content

Instantly share code, notes, and snippets.

@michielmulders
Last active July 31, 2019 10:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michielmulders/1ce264032d2625c715565c8d7008e446 to your computer and use it in GitHub Desktop.
Save michielmulders/1ce264032d2625c715565c8d7008e446 to your computer and use it in GitHub Desktop.
Invoice Transaction Undo Asset
undoAsset(store) {
const sender = store.account.get(this.senderId);
// Rollback invoice count and IDs
sender.asset.invoiceCount = sender.asset.invoiceCount === 1 ? undefined : sender.asset.invoiceCount--;
sender.asset.invoicesSent = sender.asset.invoicesSent.length === 1
? undefined
: sender.asset.invoicesSent.splice(
sender.asset.invoicesSent.indexOf(this.id),
1,
);
);
store.account.set(sender.address, sender);
return [];
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment