-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: handling delete conversation #50
base: feat/fc-18-leave-conversation
Are you sure you want to change the base?
feat: handling delete conversation #50
Conversation
24e6fa4
to
fa9ccdf
Compare
src/services/firebase/firestore.ts
Outdated
}); | ||
|
||
/** Delete all messages of the conversation */ | ||
const messageBatch = firestore().batch(); |
There was a problem hiding this comment.
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?
src/reducer/chat.ts
Outdated
@@ -52,5 +52,14 @@ export const chatReducer = ( | |||
...state, | |||
listConversation: newListConversation, | |||
}; | |||
case ChatActionKind.DELETE_CONVERSATION: |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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
?
There was a problem hiding this comment.
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 */ |
There was a problem hiding this comment.
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?
c87b7f9
to
c95adaa
Compare
Usage: