Skip to content

Commit

Permalink
fix initial state loop
Browse files Browse the repository at this point in the history
  • Loading branch information
wpdas committed Apr 8, 2024
1 parent 2d00cb2 commit c0ebca3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 18 deletions.
36 changes: 19 additions & 17 deletions lib/alem-vm/state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,23 +186,25 @@ export const props = {

// Try to load previous route for keep-route
if (props.alem.keepRoute) {
props.alem.promisify(
() => Storage.privateGet("alem::keep-route"),
(data) => {
updateAlemState({
previousRoute: data.route,
previousRouteParams: data.routeParams,
ready: true,
});
},
() => {
updateAlemState({
previousRoute: null,
ready: true,
});
},
300,
);
if (!props.alem.ready) {
props.alem.promisify(
() => Storage.privateGet("alem::keep-route"),
(data) => {
updateAlemState({
previousRoute: data.route,
previousRouteParams: data.routeParams,
ready: true,
});
},
() => {
updateAlemState({
previousRoute: null,
ready: true,
});
},
300,
);
}
} else {
updateAlemState({
previousRoute: null,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "alem",
"description": "Create web3 applications for NEAR BOS with a focus on performance and friendly development.",
"version": "1.0.0-beta.9",
"version": "1.0.0-beta.10",
"main": "main.js",
"types": "index.d.ts",
"author": "Wenderson Pires - wendersonpires.near",
Expand Down

0 comments on commit c0ebca3

Please sign in to comment.