Skip to content

Commit

Permalink
Fix old template remmoving
Browse files Browse the repository at this point in the history
  • Loading branch information
aduh95 committed Aug 17, 2019
1 parent 0cec6ed commit de81fc8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/SplashScreen.js
Expand Up @@ -38,10 +38,13 @@ export default class SplashScreen extends Component {
};
#clearSavedTemplate = () => {
return import("./app_global_state/History.js")
.then(module => module.default.clearSavedTemplate())
.then(module => module.default.clearSavedState())
.then(
() => this.setState({ previousStateDate: null }),
() => import("./notify.js").then(m => m.default("Operation failed"))
e =>
import("./notify.js").then(m =>
m.default("Operation failed", console.error(e))
)
);
};

Expand Down
2 changes: 1 addition & 1 deletion src/app_global_state/History.js
Expand Up @@ -116,7 +116,7 @@ export default new (class History extends Observable {

getLastSavedDate() {
return this.#sendCommand(PERSISTANCE_GET_LAST_SAVE_DATE).then(
timestamp => new Date(timestamp)
timestamp => timestamp && new Date(timestamp)
);
}

Expand Down

0 comments on commit de81fc8

Please sign in to comment.