Skip to content

Commit

Permalink
Merge pull request #33439 from FitseTLT/fix-slow-delete-modal-opening
Browse files Browse the repository at this point in the history
Fix delay of contact delete modal opening

(cherry picked from commit 952f1fc)
  • Loading branch information
jasperhuangg authored and OSBotify committed Dec 22, 2023
1 parent 6d90826 commit f75f3ce
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/pages/settings/Profile/Contacts/ContactMethodDetailsPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import withLocalize, {withLocalizePropTypes} from '@components/withLocalize';
import withTheme, {withThemePropTypes} from '@components/withTheme';
import withThemeStyles, {withThemeStylesPropTypes} from '@components/withThemeStyles';
import compose from '@libs/compose';
import {canUseTouchScreen} from '@libs/DeviceCapabilities';
import * as ErrorUtils from '@libs/ErrorUtils';
import Navigation from '@libs/Navigation/Navigation';
import * as Session from '@userActions/Session';
Expand Down Expand Up @@ -220,10 +221,14 @@ class ContactMethodDetailsPage extends Component {
* @param {Boolean} isOpen
*/
toggleDeleteModal(isOpen) {
InteractionManager.runAfterInteractions(() => {
if (canUseTouchScreen() && isOpen) {
InteractionManager.runAfterInteractions(() => {
this.setState({isDeleteModalOpen: isOpen});
});
Keyboard.dismiss();
} else {
this.setState({isDeleteModalOpen: isOpen});
});
Keyboard.dismiss();
}
}

/**
Expand Down

0 comments on commit f75f3ce

Please sign in to comment.