From 333b39c74f8b165f4f05723b90ec54e63057205c Mon Sep 17 00:00:00 2001 From: yggverse Date: Sun, 4 Aug 2024 03:11:37 +0300 Subject: [PATCH] deactivate logout option on identities list empty --- src/Entity/Browser/Container/Page/Auth.php | 29 +++++++++++++++------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/src/Entity/Browser/Container/Page/Auth.php b/src/Entity/Browser/Container/Page/Auth.php index 76719f43..94fb4e99 100644 --- a/src/Entity/Browser/Container/Page/Auth.php +++ b/src/Entity/Browser/Container/Page/Auth.php @@ -257,15 +257,6 @@ class Auth // Detect option type switch ($id) { - case Auth\Option\Identity::ID_LOG_OUT: - - // Logout previous session - $this->page->container->browser->database->auth->logout( - $this->page->navbar->request->getValue() - ); - - break; - case Auth\Option\Identity::ID_CRT_NEW: // Logout previous session @@ -303,6 +294,15 @@ class Auth break; + case Auth\Option\Identity::ID_LOG_OUT: + + // Logout previous session + $this->page->container->browser->database->auth->logout( + $this->page->navbar->request->getValue() + ); + + break; + default: // Logout previous session @@ -352,6 +352,17 @@ class Auth } break; + + case Auth\Option\Identity::ID_LOG_OUT: + + // Update sensibility + $option->gtk->set_sensitive( + count( + $this->_options + ) > 2 + ); + + break; } } }