mirror of
https://github.com/aljazceru/mutiny-web.git
synced 2025-12-19 07:14:22 +01:00
stop mutiny_wallet on unload
This commit is contained in:
@@ -138,6 +138,13 @@ export const Provider: ParentComponent = (props) => {
|
|||||||
if (state.user_status === "approved" && !state.mutiny_wallet && !state.deleting) {
|
if (state.user_status === "approved" && !state.mutiny_wallet && !state.deleting) {
|
||||||
console.log("running setup node manager...")
|
console.log("running setup node manager...")
|
||||||
actions.setupMutinyWallet().then(() => console.log("node manager setup done"))
|
actions.setupMutinyWallet().then(() => console.log("node manager setup done"))
|
||||||
|
|
||||||
|
// Setup an event listener to stop the mutiny wallet when the page unloads
|
||||||
|
window.onunload = async (e) => {
|
||||||
|
console.log("stopping mutiny_wallet")
|
||||||
|
await state.mutiny_wallet?.stop();
|
||||||
|
console.log("mutiny_wallet stopped")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user