comit-network / comit-i

A general-purpose web interface for comit-rs
MIT License
3 stars 0 forks source link

Clearing memorised actions from local storage when swaps are finalised #105

Open luckysori opened 5 years ago

luckysori commented 5 years ago

PR #101 introduced the concept of memorising ledger actions performed in order to inform the UI on what to display. This feature populates local storage with information that becomes irrelevant as soon as a swap is finalised (either successfully or unsuccessfully). In order to free this space @D4nte proposed the following:

Receiving `GET /swaps` response
For each action ledger in storage
  If the swap is not present in the swaps response
  OR If the status in swaps response is "FINALISED"
    Remove action ledger from storage

@thomaseizinger agreed and added that the feature should be decoupled from the general fetching of comit resources done by comit-i, proposing to either:

thomaseizinger commented 5 years ago

setInterval is not a React hook though but just a regular JS function exposed by the browser ;)