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

Adding a note to the favorite list does not work in grid view #2529

Open
4 of 6 tasks
chrgernoe opened this issue Dec 26, 2024 · 0 comments
Open
4 of 6 tasks

Adding a note to the favorite list does not work in grid view #2529

chrgernoe opened this issue Dec 26, 2024 · 0 comments

Comments

@chrgernoe
Copy link

This issue respects the following points:

Describe the bug

Clicking on the favorite icon of a note in grid mode neither adds nor removes a note from the favorite list. I checked this via the file view on the Nextcloud server / app.

I debugged the issue in the code and nailed it down to the following line:

toggleLiveData.observe(this, (next) -> toggleLiveData.removeObservers(this));

If this line is called, the method toggleFavoriteAndSync in class NotesRepository is called again which leads at the end to a neutral operation.

public void toggleFavoriteAndSync(Account account, long noteId) {

I tried to understand the reason why adding an observer leads to such a behavior but I did not succeed. Maybe there is somebody who can explain it to me. However, I also do not understand why this line is necessary at all because there is no place in the code where an observer is added to the live data. Hence, it is not necessary to remove one. If I remove the line, the app behaves as expected.

Expected behavior

No response

Notes Android version

4.3.1

Notes server version

4.11.0

Nextcloud Android version

3.30.6

Nextcloud version

30.0.4

Device

Google Pixel 4a

Android Version

13

App Store

  • Google Play Store
  • F-Droid
  • Huawei App Gallery

Stacktrace

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants