Skip to content

feat: handling delete conversation#50

Open
danhmaisgt wants to merge 8 commits intofeat/fc-18-leave-conversationfrom
feat/delete-conversation
Open

feat: handling delete conversation#50
danhmaisgt wants to merge 8 commits intofeat/fc-18-leave-conversationfrom
feat/delete-conversation

Conversation

@danhmaisgt
Copy link
Copy Markdown
Contributor

@danhmaisgt danhmaisgt commented Jul 9, 2024

Usage:

import {useConversation} from 'rn-firebase-chat'

const {deleteConversation} = useConversation()

await deleteConversation(conversationId, true)

@danhmaisgt danhmaisgt changed the title feat: handling delete conversation [DRAFT] feat: handling delete conversation Jul 15, 2024
@loc-nguyenthien loc-nguyenthien force-pushed the feature/adding_setting_prefix_for_firestore branch 3 times, most recently from 24e6fa4 to fa9ccdf Compare July 19, 2024 03:37
Base automatically changed from feature/adding_setting_prefix_for_firestore to master July 23, 2024 06:28
@danhmaisgt danhmaisgt changed the title [DRAFT] feat: handling delete conversation feat: handling delete conversation Jul 24, 2024
Comment thread src/services/firebase/firestore.ts Outdated
});

/** Delete all messages of the conversation */
const messageBatch = firestore().batch();
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why we need delete all message?

Comment thread src/reducer/chat.ts Outdated
...state,
listConversation: newListConversation,
};
case ChatActionKind.DELETE_CONVERSATION:
Copy link
Copy Markdown
Contributor

@huydosgtech huydosgtech Aug 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this related to listConversation, so we should rename action more meaning like as UPDATE_LIST_CONVERSATION

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this name is ok, if you want it to be clearer, how about DELETE_CONVERSATION_IN_LIST?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, it's good to me

await userConversation.delete();
if (!forAllMembers) return true;

/** Delete latest message of that conversation for all other partners */
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we split the function even smaller?

@danhmaisgt danhmaisgt force-pushed the feat/delete-conversation branch from c87b7f9 to c95adaa Compare October 15, 2024 07:10
@danhmaisgt danhmaisgt changed the base branch from master to feat/fc-18-leave-conversation October 15, 2024 08:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants