Skip to content

Commit

Permalink
Add a comment for the handling of initEditing = null
Browse files Browse the repository at this point in the history
  • Loading branch information
eason9487 committed Aug 6, 2021
1 parent 3897636 commit 63460f7
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions js/src/components/contact-information/phone-number-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ export default function PhoneNumberCard( {
isPreview ? false : initEditing
);

// Handle the initial UI state of `initEditing = null`.
// The `isEditing` state is on hold. Determine it after the `phoneNumber` loaded.
useEffect( () => {
if ( loaded && isEditing === null ) {
setEditing( ! data.isValid );
Expand Down

0 comments on commit 63460f7

Please sign in to comment.