Skip to content

Instantly share code, notes, and snippets.

@vdhanan
Created September 20, 2024 08:21

Revisions

  1. vdhanan created this gist Sep 20, 2024.
    62 changes: 62 additions & 0 deletions testplan.patch
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,62 @@
    varun@varuns-MacBook-Pro web % git diff
    diff --git a/web/settings/password-change-modal.js b/web/settings/password-change-modal.js
    index 59a041416a..f534c474e6 100644
    --- a/web/settings/password-change-modal.js
    +++ b/web/settings/password-change-modal.js
    @@ -3,6 +3,10 @@
    import invariant from 'invariant';
    import * as React from 'react';

    +import {
    + fetchAllCommunityInfosWithNames,
    + fetchAllCommunityInfosWithNamesActionTypes,
    +} from 'lib/actions/community-actions.js';
    import {
    changeKeyserverUserPasswordActionTypes,
    changeKeyserverUserPassword,
    @@ -13,6 +17,7 @@ import { useModalContext } from 'lib/components/modal-provider.react.js';
    import { useStringForUser } from 'lib/hooks/ens-cache.js';
    import { useLegacyAshoatKeyserverCall } from 'lib/keyserver-conn/legacy-keyserver-call.js';
    import { createLoadingStatusSelector } from 'lib/selectors/loading-selectors.js';
    +import type { FetchAllCommunityInfosWithNamesResponse } from 'lib/types/community-types.js';
    import { type PasswordUpdate } from 'lib/types/user-types.js';
    import { getMessageForException } from 'lib/utils/errors.js';
    import {
    @@ -37,6 +42,7 @@ type Props = {
    oldPassword: string,
    newPassword: string,
    ) => Promise<void>,
    + +fetchAllCommunities: () => Promise<FetchAllCommunityInfosWithNamesResponse>,
    +popModal: () => void,
    +stringForUser: ?string,
    };
    @@ -194,6 +200,11 @@ class PasswordChangeModal extends React.PureComponent<Props, State> {
    return;
    }

    + void this.props.dispatchActionPromise(
    + fetchAllCommunityInfosWithNamesActionTypes,
    + this.props.fetchAllCommunities(),
    + );
    +
    if (usingCommServicesAccessToken) {
    void this.props.dispatchActionPromise(
    changeIdentityUserPasswordActionTypes,
    @@ -272,6 +283,9 @@ const ConnectedPasswordChangeModal: React.ComponentType<{}> = React.memo<{}>(
    const callChangeKeyserverUserPassword = useLegacyAshoatKeyserverCall(
    changeKeyserverUserPassword,
    );
    + const callFetchAllCommunities = useLegacyAshoatKeyserverCall(
    + fetchAllCommunityInfosWithNames,
    + );
    const callChangeIdentityUserPassword = useChangeIdentityUserPassword();
    const dispatchActionPromise = useDispatchActionPromise();

    @@ -285,6 +299,7 @@ const ConnectedPasswordChangeModal: React.ComponentType<{}> = React.memo<{}>(
    inputDisabled={inputDisabled}
    changeKeyserverUserPassword={callChangeKeyserverUserPassword}
    changeIdentityUserPassword={callChangeIdentityUserPassword}
    + fetchAllCommunities={callFetchAllCommunities}
    dispatchActionPromise={dispatchActionPromise}
    popModal={modalContext.popModal}
    stringForUser={stringForUser}