Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Refactor sort type handling, and fetching initData/Posts, fixes default sort in community#1166

Merged
twizmwazin merged 8 commits into
LemmyNet:mainfrom
MV-GH:refactor/startup_sort_stuff
Aug 15, 2023
Merged

Refactor sort type handling, and fetching initData/Posts, fixes default sort in community#1166
twizmwazin merged 8 commits into
LemmyNet:mainfrom
MV-GH:refactor/startup_sort_stuff

Conversation

@MV-GH

@MV-GH MV-GH commented Aug 10, 2023

Copy link
Copy Markdown
Collaborator

Refactors

  • Fixes community sort not using the default home sort
  • Fixes swap account not changing the sort
  • Show toast when saving usersettings fails
  • Refactors homeFetch/initialdata, instead of putting the responsibility on each action that changes user to properly update the sort/home fetch data, now HomeActivity itself takes care of it.
  • SiteViewmodel now properly updates the default in Account, basically since the navscope changes we were ignoring the local DB defaults, previously it waited until /site responded before fetching home posts, now it instantly fetches using the info from the account.

Fixes #1163
Fixes #886

Note: since account default sort/list types haven't been updates since like 0.34, many will be out of date, thus when those user launch it, it will fetch the home posts twice, once with those settings from that account and once /site is retrieved and updates the account default which triggers another fetch but with the latest sort.

@MV-GH MV-GH changed the title Refactor sort type handling, and fetching initData/Posts Refactor sort type handling, and fetching initData/Posts, fixes default sort in community Aug 10, 2023
MV-GH added 3 commits August 11, 2023 18:02
# Conflicts:
#	app/src/main/java/com/jerboa/model/HomeViewModel.kt
#	app/src/main/java/com/jerboa/model/SiteViewModel.kt
#	app/src/main/java/com/jerboa/ui/components/community/CommunityActivity.kt
@twizmwazin twizmwazin enabled auto-merge (squash) August 14, 2023 22:44
@twizmwazin twizmwazin merged commit ace82a0 into LemmyNet:main Aug 15, 2023
@MV-GH MV-GH deleted the refactor/startup_sort_stuff branch August 15, 2023 08: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.

Community sort posts is not using the default specified in the settings Filters are different in server & local database.

2 participants