Skip to content

Commit

Permalink
Destructuring
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhamkmr04 committed Aug 28, 2024
1 parent 9cd8e39 commit 9bad513
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
7 changes: 3 additions & 4 deletions views/ContactDetails.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ export default class ContactDetails extends React.Component<
render() {
const { isLoading, isNostrContact } = this.state;
const { navigation, ContactStore } = this.props;
const { setPrefillContact } = ContactStore;

const contact = new Contact(this.state.contact);
const nostrContact = this.props.route.params?.nostrContact;
Expand All @@ -239,7 +240,7 @@ export default class ContactDetails extends React.Component<
const EditContactButton = () => (
<TouchableOpacity
onPress={() => {
ContactStore.setPrefillContact(contact);
setPrefillContact(contact);
navigation.navigate('AddContact', {
isEdit: true
});
Expand Down Expand Up @@ -681,9 +682,7 @@ export default class ContactDetails extends React.Component<
<Button
onPress={() => {
navigation.goBack();
ContactStore.setPrefillContact(
nostrContact
);
setPrefillContact(nostrContact);
navigation.navigate('AddContact', {
isEdit: true,
isNostrContact
Expand Down
5 changes: 3 additions & 2 deletions views/Settings/Contacts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ export default class Contacts extends React.Component<

render() {
const { navigation, ContactStore } = this.props;
const { loading } = ContactStore;
const { search, SendScreen, deletionAwaitingConfirmation } = this.state;
const { contacts } = ContactStore;
const filteredContacts = contacts.filter((contact: any) => {
Expand Down Expand Up @@ -402,7 +403,7 @@ export default class Contacts extends React.Component<
keyExtractor={(_, index) => index.toString()}
scrollEnabled={false}
/>
{!ContactStore?.loading && contacts.length > 1 && (
{!loading && contacts.length > 1 && (
<Button
title={
deletionAwaitingConfirmation
Expand Down Expand Up @@ -438,7 +439,7 @@ export default class Contacts extends React.Component<
secondary
/>
)}
{ContactStore?.loading ? (
{loading ? (
<LoadingIndicator />
) : (
contacts.length === 0 && (
Expand Down

0 comments on commit 9bad513

Please sign in to comment.