Closed IroncladDev closed 10 months ago
I'll look into it more thoroughly later, could you clean up the git history a bit please (see https://git-scm.com/book/en/v2/Git-Tools-Rewriting-History for help)?
It's funny that not having persistent storage for the client leads to the idea to at least save the join codes :laughing: you still lose all your e-cash, but at least you can join the same federation again. Don't get me wrong, this is certainly useful for testing, just very funny imo :rofl:
Whoops, sorry, I think I nuked the entire branch.
I can move all my changes to a new branch and start again if you want.
As a followup PR, I'll make transactions persistent in localstorage.
As a followup PR, I'll make transactions persistent in localstorage.
What would be your strategy for that? Implementing a proper transactional KV store on top of it seems non-trivial. A workaround that is broken but works most of the time would be saving the in-memory DB to local storage periodically (ideally on every commit with writes).
I think this got closed by #33
Why
It's difficult to have to paste in a fedimint invite code every time the page reloads. Additionally, if you enter an invalid federation there's just a blank screen and no error indications.
Changes
src/components/failure.rs
) if the federation client fails to join the specified invite code. Pressing the "Try again" button refreshes the page.src/components/app.rs:27
) and the federation name/label (src/components/joined.rs:46
) are saved to local storage to be accessed later. If the localstorage values exist, a clickable component will be shown on the initial connection screen. Clicking it auto-fills the input.Other Changes
Cargo.toml
- added theStorage
feature toweb-sys
to enable the use ofwindow.localStorage
src/utils/local_storage.rs
- created alocal_storage
util that returnswindow.localStorage
overweb-sys
Test Plan
cat target/devimint/cfg/invite-code
in the fedimint shelltrunk serve