aboutsummaryrefslogtreecommitdiff
path: root/src/Analyze.tsx
diff options
context:
space:
mode:
authorDeterminant <ted.sybil@gmail.com>2019-02-16 23:37:17 -0500
committerDeterminant <ted.sybil@gmail.com>2019-02-16 23:37:17 -0500
commit8bc7527072d9d42efd90ae6a4847648c11d48def (patch)
treef55320a25a40e9cc31afbb811867cc6b8e4a7f36 /src/Analyze.tsx
parentf44c7b95ec85ce10bf8f4dcb1f0d6cdbd2fd0e7f (diff)
improve Settings
Diffstat (limited to 'src/Analyze.tsx')
-rw-r--r--src/Analyze.tsx20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/Analyze.tsx b/src/Analyze.tsx
index 9339289..4e2df49 100644
--- a/src/Analyze.tsx
+++ b/src/Analyze.tsx
@@ -141,12 +141,11 @@ class Analyze extends React.Component<AnalyzeProps> {
calendarGraphData: r.calendarGraphData });
}
- reset = () => {
- this.openDialog("Reset", "Are you sure to reset the patterns?").then(ans => {
- if (!ans) return;
- this.loadPatterns([]);
- this.setState({ startDate: null, endDate: null });
- });
+ reset = async () => {
+ let ans = this.openDialog("Reset", "Are you sure to reset the patterns?");
+ if (!ans) return;
+ this.loadPatterns([]);
+ this.setState({ startDate: null, endDate: null });
}
loadDefaultPatterns() {
@@ -163,11 +162,10 @@ class Analyze extends React.Component<AnalyzeProps> {
this.loadPatterns(patterns);
}
- loadDefault = () => {
- this.openDialog("Load Default", "Load the calendars as patterns?").then(ans => {
- if (!ans) return;
- this.loadDefaultPatterns();
- });
+ loadDefault = async () => {
+ let ans = await this.openDialog("Load Default", "Load the calendars as patterns?");
+ if (!ans) return;
+ this.loadDefaultPatterns();
}
openSnackbar(msg: string, variant: SnackbarVariant) {