vegaprotocol / vegawallet-desktop

Desktop application for Vega Protocol's wallet
MIT License
15 stars 12 forks source link

Migrate generic `new_interaction` event to dedicated events #533

Closed ValentinTrinque closed 10 months ago

ValentinTrinque commented 1 year ago

Today, we emit a generic new_interaction event with the specific interaction event as a value.

After a discussion with @notbot00, we came to the conclusion having specific events is much easier for the frontend.

Technical implications

On the backend

- wailsRuntime.EmitEvent(ctx, "new_interaction", interaction)
+ wailsRuntime.EmitEvent(ctx, interaction.Name, interaction)

On the frontend

- runtime.OnEvent("new_interaction", func() {
-   // handling generic event
- })
+ runtime.OnEvent("request_wallet_connection", func() {})
+ runtime.OnEvent("request_transaction_review_for_sending", func() {})
+ // Etc...

Events to listen to