diff --git a/assets/images/tgpt/center-icon2-unselected.png b/assets/images/tgpt/center-icon2-unselected.png new file mode 100644 index 000000000..90c8beaad Binary files /dev/null and b/assets/images/tgpt/center-icon2-unselected.png differ diff --git a/lib/core/providers/user.dart b/lib/core/providers/user.dart index 82a329457..dcb1da2e6 100644 --- a/lib/core/providers/user.dart +++ b/lib/core/providers/user.dart @@ -259,7 +259,9 @@ class UserDataProvider extends ChangeNotifier { /// Logs out user /// Unregisters device from direct push notification using [_pushNotificationDataProvider] /// Resets all [AuthenticationModel] and [UserProfileModel] data from persistent storage - void logout() async { + /// [clearChatHistory] must be true to delete local TGPT chat history; pass true only from + /// the explicit user-initiated logout action, not from automated auth-refresh paths. + void logout({bool clearChatHistory = false}) async { _error = null; _isLoading = true; notifyListeners(); @@ -267,7 +269,7 @@ class UserDataProvider extends ChangeNotifier { resetAllCardHeights(); resetNotificationsScrollOffset(); _pushNotificationDataProvider.unregisterDevice(_authenticationModel.accessToken); - await _chatPersistenceService.clearUserChatData(); + if (clearChatHistory) await _chatPersistenceService.clearUserChatData(); updateAuthenticationModel(AuthenticationModel.fromJson({})); updateUserProfileModel(await _createNewUser(UserProfileModel.fromJson({}))); _deletePasswordFromDevice(); diff --git a/lib/ui/navigator/bottom.dart b/lib/ui/navigator/bottom.dart index 55d9e7841..01e6c4427 100644 --- a/lib/ui/navigator/bottom.dart +++ b/lib/ui/navigator/bottom.dart @@ -133,6 +133,9 @@ class _BottomTabBarState extends State { } Widget _buildAIAssistantIcon(bool isSelected, ThemeData theme) { + final iconAsset = + isSelected ? 'assets/images/tgpt/center-icon2.png' : 'assets/images/tgpt/center-icon2-unselected.png'; + return Container( height: 34, margin: const EdgeInsets.only(top: 4), @@ -142,13 +145,10 @@ class _BottomTabBarState extends State { borderRadius: BorderRadius.circular(34), ), child: Image.asset( - 'assets/images/tgpt/center-icon2.png', + iconAsset, width: 34, height: 34, - color: isSelected - ? theme.bottomNavigationBarTheme.selectedItemColor - : theme.bottomNavigationBarTheme.unselectedItemColor, - colorBlendMode: BlendMode.srcIn, + filterQuality: FilterQuality.high, ), ); } diff --git a/lib/ui/profile/login.dart b/lib/ui/profile/login.dart index 9ae09ccf6..d242cc604 100644 --- a/lib/ui/profile/login.dart +++ b/lib/ui/profile/login.dart @@ -104,7 +104,7 @@ class _LoginState extends State { void executeLogout() { _passwordTextFieldController.clear(); _emailTextFieldController.clear(); - _userDataProvider.logout(); + _userDataProvider.logout(clearChatHistory: true); } Widget buildLoginWidget() {