From 14274bc2040d95242e01d55543a1bd2dd1a8ae62 Mon Sep 17 00:00:00 2001 From: Michael Date: Sat, 17 Oct 2020 18:52:05 +0000 Subject: [PATCH] Store the selected network tab in a session variable --- src/Module/Conversation/Network.php | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/Module/Conversation/Network.php b/src/Module/Conversation/Network.php index 34b0753a4..1138f254a 100644 --- a/src/Module/Conversation/Network.php +++ b/src/Module/Conversation/Network.php @@ -11,6 +11,7 @@ use Friendica\Content\Text\HTML; use Friendica\Core\ACL; use Friendica\Core\Hook; use Friendica\Core\Renderer; +use Friendica\Core\Session; use Friendica\Database\DBA; use Friendica\DI; use Friendica\Model\Contact; @@ -282,7 +283,7 @@ class Network extends BaseModule self::$forumContactId = $parameters['contact_id'] ?? 0; - self::$selectedTab = ''; + self::$selectedTab = Session::get('network-tab', ''); if (!empty($get['star'])) { self::$selectedTab = 'star'; @@ -296,9 +297,16 @@ class Network extends BaseModule self::$selectedTab = $get['order']; } + Session::set('network-tab', self::$selectedTab); + self::$star = intval($get['star'] ?? 0); self::$mention = intval($_GET['mention'] ?? 0); - self::$order = $get['order'] ?? 'commented'; + self::$order = $get['order'] ?? Session::get('network-order', 'commented'); + + self::$selectedTab = self::$selectedTab ?? self::$order; + + Session::set('network-tab', self::$selectedTab); + Session::set('network-order', self::$order); self::$accountTypeString = $_GET['accounttype'] ?? $parameters['accounttype'] ?? ''; self::$accountType = User::getAccountTypeByString(self::$accountTypeString);