Skip to content
Merged
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
2 changes: 1 addition & 1 deletion frontend/lib/presentation/profile/cubit/profile_cubit.dart
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class ProfileCubit extends Cubit<ProfileState> {
try {
final updatedProfile = await _userRepository.updateUserProfile(data);
_authService.updateDetailedProfile(updatedProfile);
emit(ProfileLoaded(userProfile: updatedProfile));
emit(ProfileSaved(userProfile: updatedProfile));
} on ApiException catch (e) {
emit(ProfileUpdateError(
userProfile: loadedState.userProfile, message: e.message));
Expand Down
4 changes: 4 additions & 0 deletions frontend/lib/presentation/profile/cubit/profile_state.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
import 'package:equatable/equatable.dart';
import 'package:resellio/core/models/models.dart';

class ProfileSaved extends ProfileLoaded {
const ProfileSaved({required super.userProfile}) : super(isEditing: false);
}

abstract class ProfileState extends Equatable {
const ProfileState();
@override
Expand Down
4 changes: 1 addition & 3 deletions frontend/lib/presentation/profile/pages/profile_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,7 @@ class _ProfileView extends StatelessWidget {
],
body: BlocListener<ProfileCubit, ProfileState>(
listener: (context, state) {
if (state is ProfileLoaded &&
!state.isEditing &&
state is! ProfileSaving) {
if (state is ProfileSaved) {
ScaffoldMessenger.of(context)
..hideCurrentSnackBar()
..showSnackBar(
Expand Down