UnigramDev / Unigram

Telegram for Windows
https://www.microsoft.com/store/apps/9n97zckpd60q
GNU General Public License v3.0
3.9k stars 450 forks source link

Chat background selector is not remembering selected background #2568

Closed makisukurisu closed 1 year ago

makisukurisu commented 2 years ago

Describe the bug Title is a bit misleading, but that's core issue IMO. So, if you select image background, and choose it to be either blurred or not (= state) Then if you return to chat background setting and click on already selected image background and set it to !state, it wont change. And checkbox (checkcircle) will always show Not Blurred option by default (thus - name of the issue).

So main problem is that state doesn't change to !state without picking another background first.

To Reproduce Steps to reproduce the behavior:

  1. Go to Chat Settings
  2. Click on Chat Background
  3. Select some image background (cloud ones work for sure) and set it's Blur checkbox = state (remember it)
  4. Go to any chat to see results
  5. Repeat steps 1-2
  6. Select same image background and set it's Blur checkbox = !state ( ! being NOT logical operator)
  7. Repeat step 4 and see changes not getting applied

Note as I write this. Same happens with all types of backgrounds.

Expected behavior Unigram to remember applied settings to current background (at least, and IMO, there can be some caching to remember settings of applied backgrounds for each and every one applied)

Screenshots image 1-2 done, state = false image 3-4 done, result = no blur image 5 done, setting to !state = true image 6-7 done, result = no blur = previous result = no change = bug

Version Info

Additional context That's a long one for a small issue

makisukurisu commented 2 years ago

@makisukurisu Another note. State does change, but only after you reopen the app.

FrayxRulez commented 2 years ago

Is it still the case?

makisukurisu commented 2 years ago

It sets background as it should, but check mark is not remembered.

FrayxRulez commented 1 year ago

Still?

makisukurisu commented 1 year ago

Fela, please tell me, if this should be brought up in a different issue, or if this "improv" can stay in this issue. There's a little "cache" (not sure how it's implemented) problem, but I'd say it's pretty minor.

The problem is that "cache" is updated when you open the Chat Background Page. (Or - so it seems) I think that updating this "cache" on pressing "Set" button (perhaps "Cancel" too?) would be a bit better. Example of possible issue:

https://user-images.githubusercontent.com/49622129/210176875-d536550f-47b8-4a3d-98a5-683ae08e4bd8.mp4

The issue is as follows:

  1. I had a background with no blur
  2. I apply blur to a background and hit "Set" 2.1. ❗ Preview is still using already outdated setting (preview should be now blurred) 2.2. ❗ If I reopen same background to change it again - it will load as if it was not changed since step 1. (So - it has "Blur" set to off, since it was it's original state)