Step 5: Fix newly-discovered TS issues

This commit is contained in:
Travis Ralston 2022-03-04 16:42:16 -07:00
parent 7e21da0c7f
commit 115ae198c8
3 changed files with 6 additions and 5 deletions

View File

@ -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<string, string>;
replaceMap?: Record<string, string>;
}
interface IState {

View File

@ -174,7 +174,7 @@ export default class AccessSecretStorageDialog extends React.PureComponent<IProp
this.fileUpload.current.click();
};
private onPassPhraseNext = async (ev: FormEvent<HTMLFormElement>) => {
private onPassPhraseNext = async (ev: FormEvent<HTMLFormElement> | React.MouseEvent) => {
ev.preventDefault();
if (this.state.passPhrase.length <= 0) return;
@ -189,7 +189,7 @@ export default class AccessSecretStorageDialog extends React.PureComponent<IProp
}
};
private onRecoveryKeyNext = async (ev: FormEvent<HTMLFormElement>) => {
private onRecoveryKeyNext = async (ev: FormEvent<HTMLFormElement> | React.MouseEvent) => {
ev.preventDefault();
if (!this.state.recoveryKeyValid) return;

View File

@ -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<void>);
// should there be a cancel button? default: true
hasCancel?: boolean;