From 4e42dbe4188eba9ecaad8ae0d64e325d10e69e16 Mon Sep 17 00:00:00 2001 From: "J. Ryan Stinnett" Date: Tue, 17 Sep 2019 14:56:55 +0100 Subject: [PATCH] Fix address type props to state conversion The address picker recently started tracking props and state versions of valid address types separately (https://github.com/matrix-org/matrix-react-sdk/pull/3408), where props represents the maximal set of possible types and the state is the current available types right now (since it can change while the dialog is open). For the case where there is no a IS, a regression was introduced by that PR by mutating the props in place instead returning a modified copy for the state. Regressed by https://github.com/matrix-org/matrix-react-sdk/pull/3408 Fixes https://github.com/vector-im/riot-web/issues/10878 --- src/components/views/dialogs/AddressPickerDialog.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/views/dialogs/AddressPickerDialog.js b/src/components/views/dialogs/AddressPickerDialog.js index 32c5cf6900..1eac07dbfd 100644 --- a/src/components/views/dialogs/AddressPickerDialog.js +++ b/src/components/views/dialogs/AddressPickerDialog.js @@ -80,7 +80,7 @@ module.exports = createReactClass({ let validAddressTypes = this.props.validAddressTypes; // Remove email from validAddressTypes if no IS is configured. It may be added at a later stage by the user if (!MatrixClientPeg.get().getIdentityServerUrl() && validAddressTypes.includes("email")) { - validAddressTypes = validAddressTypes.splice(validAddressTypes.indexOf("email"), 1); + validAddressTypes = validAddressTypes.filter(type => type !== "email"); } return {