Bugfix: Remove 500 Errors in Conversation Dashboard #420
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Right now if you are on the main branch, login, go to the conversation screen and open the drawer with all the conversation cards, you will probably get some console log statements like in the screenshot below. The number of errors depends on the amount of conversation cards you have and the state they are in.
Those error messages came from the ViewSelectedTopicsModal, because it wanted to call
apiClient.getSelectedTopics
for conversations that weren't in a conversation state where this call is possible. So by adding an if check for the conversation state before the api call, the errors disappeared.Checklist
Additional Comments
I checked that I don't add technical debt with this pr, which probably is true. But there is already existing technical debt that we need to address in the future. This involves cleaning up the components and extracting the logic into hooks, similar to the quiz refactoring we did.