Rename reset secret storage prop

The bare word `force` has bothered me, so this adds a tiny amount more meaning.
This commit is contained in:
J. Ryan Stinnett 2020-08-27 13:50:50 +01:00
parent 4a807f9385
commit 3a98b4b4e9
2 changed files with 8 additions and 8 deletions

View file

@ -218,7 +218,7 @@ export async function accessSecretStorage(func = async () => { }, forceReset = f
const { finished } = Modal.createTrackedDialogAsync('Create Secret Storage dialog', '', const { finished } = Modal.createTrackedDialogAsync('Create Secret Storage dialog', '',
import("./async-components/views/dialogs/secretstorage/CreateSecretStorageDialog"), import("./async-components/views/dialogs/secretstorage/CreateSecretStorageDialog"),
{ {
force: forceReset, forceReset,
}, },
null, null,
/* priority = */ false, /* priority = */ false,

View file

@ -56,12 +56,12 @@ export default class CreateSecretStorageDialog extends React.PureComponent {
static propTypes = { static propTypes = {
hasCancel: PropTypes.bool, hasCancel: PropTypes.bool,
accountPassword: PropTypes.string, accountPassword: PropTypes.string,
force: PropTypes.bool, forceReset: PropTypes.bool,
}; };
static defaultProps = { static defaultProps = {
hasCancel: true, hasCancel: true,
force: false, forceReset: false,
}; };
constructor(props) { constructor(props) {
@ -118,8 +118,8 @@ export default class CreateSecretStorageDialog extends React.PureComponent {
MatrixClientPeg.get().isCryptoEnabled() && await MatrixClientPeg.get().isKeyBackupTrusted(backupInfo) MatrixClientPeg.get().isCryptoEnabled() && await MatrixClientPeg.get().isKeyBackupTrusted(backupInfo)
); );
const { force } = this.props; const { forceReset } = this.props;
const phase = (backupInfo && !force) ? PHASE_MIGRATE : PHASE_CHOOSE_KEY_PASSPHRASE; const phase = (backupInfo && !forceReset) ? PHASE_MIGRATE : PHASE_CHOOSE_KEY_PASSPHRASE;
this.setState({ this.setState({
phase, phase,
@ -277,11 +277,11 @@ export default class CreateSecretStorageDialog extends React.PureComponent {
const cli = MatrixClientPeg.get(); const cli = MatrixClientPeg.get();
const { force } = this.props; const { forceReset } = this.props;
try { try {
if (force) { if (forceReset) {
console.log("Forcing secret storage reset"); // log something so we can debug this later console.log("Forcing cross-signing and secret storage reset");
await cli.bootstrapCrossSigning({ await cli.bootstrapCrossSigning({
authUploadDeviceSigningKeys: this._doBootstrapUIAuth, authUploadDeviceSigningKeys: this._doBootstrapUIAuth,
setupNewCrossSigning: true, setupNewCrossSigning: true,