]> git.mxchange.org Git - friendica.git/commitdiff
Merge pull request #13451 from annando/no-jump
authorHypolite Petovan <hypolite@mrpetovan.com>
Wed, 20 Sep 2023 13:08:14 +0000 (09:08 -0400)
committerGitHub <noreply@github.com>
Wed, 20 Sep 2023 13:08:14 +0000 (09:08 -0400)
Avoid jumps in the timeline after "received" has been selected

src/Module/Conversation/Network.php

index 21ead331f0a770f273f99381267c0caea4a58f71..beb3a72f3e0b41c2251d0ba57ecd2bfd63544c8a 100644 (file)
@@ -348,14 +348,16 @@ class Network extends Timeline
                        $this->order = 'commented';
                }
 
+               $this->selectedTab = $this->selectedTab ?? $this->order;
+
                // Upon updates in the background and order by last comment we order by received date,
                // since otherwise the feed will optically jump, when some already visible thread has been updated.
                if ($this->update && ($this->selectedTab == TimelineEntity::COMMENTED)) {
                        $this->order = 'received';
+                       $request['last_received']  = $request['last_commented'] ?? null;
+                       $request['first_received'] = $request['first_commented'] ?? null;
                }
 
-               $this->selectedTab = $this->selectedTab ?? $this->order;
-
                // Prohibit combined usage of "star" and "mention"
                if ($this->selectedTab == TimelineEntity::STAR) {
                        $this->mention = false;