Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added assets/images/tgpt/center-icon2-unselected.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions lib/core/providers/user.dart
Original file line number Diff line number Diff line change
Expand Up @@ -259,15 +259,17 @@ 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();
resetHomeScrollOffset();
resetAllCardHeights();
resetNotificationsScrollOffset();
_pushNotificationDataProvider.unregisterDevice(_authenticationModel.accessToken);
await _chatPersistenceService.clearUserChatData();
if (clearChatHistory) await _chatPersistenceService.clearUserChatData();
updateAuthenticationModel(AuthenticationModel.fromJson({}));
updateUserProfileModel(await _createNewUser(UserProfileModel.fromJson({})));
_deletePasswordFromDevice();
Expand Down
10 changes: 5 additions & 5 deletions lib/ui/navigator/bottom.dart
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,9 @@ class _BottomTabBarState extends State<BottomTabBar> {
}

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),
Expand All @@ -142,13 +145,10 @@ class _BottomTabBarState extends State<BottomTabBar> {
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,
),
);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/ui/profile/login.dart
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class _LoginState extends State<Login> {
void executeLogout() {
_passwordTextFieldController.clear();
_emailTextFieldController.clear();
_userDataProvider.logout();
_userDataProvider.logout(clearChatHistory: true);
}

Widget buildLoginWidget() {
Expand Down
Loading