Skip to content
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

fix for discussion pull to refresh #393

Merged

Conversation

rnr
Copy link
Contributor

@rnr rnr commented Apr 11, 2024

This PR fixes issue #358 when after pull-to-refresh user sees 'old' data.
Added actual data retrieval for "parent message" in Thread and Responses Views

Issue recording:

Exported.MPEG-4.movie3.mp4

@@ -88,19 +90,23 @@ public class ResponsesViewModel: BaseResponsesViewModel, ObservableObject {
}

@MainActor
func getComments(commentID: String, parentComment: Post, page: Int) async -> Bool {
func getResponsesData(commentID: String, parentComment: Post, page: Int, refresh: Bool = false) async -> Bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

You have renamed the getComments to getResponsesData but there are other elements which are according to the old method name like self.comments. Do we need to update them as well to it's ok to just update the method name?

Copy link
Contributor Author

@rnr rnr Apr 16, 2024

Choose a reason for hiding this comment

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

I renamed it to getResponsesData because now we get not only the comments here, but also the parent post data - so now it doesn't just work with comments but with several data types.

@saeedbashir
Copy link
Contributor

@rnr The code is not compiling at my end and I am getting the following errors. I've tried by cleaning and even by deleting the derived data.
image

@volodymyr-chekyrta volodymyr-chekyrta merged commit 5748181 into openedx:develop Apr 19, 2024
3 checks passed
@rnr rnr deleted the 358-fix-for-discussion-pull-to-refresh branch April 19, 2024 09:45
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.

[iOS] Follow/Vote/Report marks disappears after refreshing Discussion page
4 participants