From 115ae198c869efd504ee2d8acd58b6b58039fe54 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Fri, 4 Mar 2022 16:42:16 -0700 Subject: [PATCH] Step 5: Fix newly-discovered TS issues --- src/components/structures/EmbeddedPage.tsx | 2 +- .../views/dialogs/security/AccessSecretStorageDialog.tsx | 4 ++-- src/components/views/elements/DialogButtons.tsx | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/components/structures/EmbeddedPage.tsx b/src/components/structures/EmbeddedPage.tsx index 4b309a1838..9ba250c985 100644 --- a/src/components/structures/EmbeddedPage.tsx +++ b/src/components/structures/EmbeddedPage.tsx @@ -37,7 +37,7 @@ interface IProps { // Whether to wrap the page in a scrollbar scrollbar?: boolean; // Map of keys to replace with values, e.g {$placeholder: "value"} - replaceMap?: Map; + replaceMap?: Record; } interface IState { diff --git a/src/components/views/dialogs/security/AccessSecretStorageDialog.tsx b/src/components/views/dialogs/security/AccessSecretStorageDialog.tsx index f0dca76bfb..a50ac2bb94 100644 --- a/src/components/views/dialogs/security/AccessSecretStorageDialog.tsx +++ b/src/components/views/dialogs/security/AccessSecretStorageDialog.tsx @@ -174,7 +174,7 @@ export default class AccessSecretStorageDialog extends React.PureComponent) => { + private onPassPhraseNext = async (ev: FormEvent | React.MouseEvent) => { ev.preventDefault(); if (this.state.passPhrase.length <= 0) return; @@ -189,7 +189,7 @@ export default class AccessSecretStorageDialog extends React.PureComponent) => { + private onRecoveryKeyNext = async (ev: FormEvent | React.MouseEvent) => { ev.preventDefault(); if (!this.state.recoveryKeyValid) return; diff --git a/src/components/views/elements/DialogButtons.tsx b/src/components/views/elements/DialogButtons.tsx index ed0d6cd9e6..2a3554e876 100644 --- a/src/components/views/elements/DialogButtons.tsx +++ b/src/components/views/elements/DialogButtons.tsx @@ -30,8 +30,9 @@ interface IProps { // If true, make the primary button a form submit button (input type="submit") primaryIsSubmit?: boolean; - // onClick handler for the primary button. - onPrimaryButtonClick?: (ev: React.MouseEvent) => void; + // onClick handler for the primary button. Note that the returned promise, if + // returning a promise, is not used. + onPrimaryButtonClick?: (ev: React.MouseEvent) => (void | Promise); // should there be a cancel button? default: true hasCancel?: boolean;