Don’t allow disconnecting Google if Gmail is connected
This commit is contained in:
parent
9af66a5f33
commit
f4fec989d7
|
|
@ -228,20 +228,24 @@ class _UserDetailsState extends State<UserDetails>
|
|||
? localization.disconnectGoogle
|
||||
: localization.connectGoogle)
|
||||
.toUpperCase()),
|
||||
onPressed: () {
|
||||
if (state.settingsUIState.isChanged) {
|
||||
showMessageDialog(
|
||||
context: context,
|
||||
message: localization.errorUnsavedChanges);
|
||||
return;
|
||||
}
|
||||
onPressed: state.user.isConnectedToGmail
|
||||
? null
|
||||
: () {
|
||||
if (state.settingsUIState.isChanged) {
|
||||
showMessageDialog(
|
||||
context: context,
|
||||
message:
|
||||
localization.errorUnsavedChanges);
|
||||
return;
|
||||
}
|
||||
|
||||
if (state.user.isConnectedToGoogle) {
|
||||
viewModel.onDisconnectGooglePressed(context);
|
||||
} else {
|
||||
viewModel.onConnectGooglePressed(context);
|
||||
}
|
||||
},
|
||||
if (state.user.isConnectedToGoogle) {
|
||||
viewModel
|
||||
.onDisconnectGooglePressed(context);
|
||||
} else {
|
||||
viewModel.onConnectGooglePressed(context);
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
SizedBox(width: kTableColumnGap),
|
||||
|
|
|
|||
Loading…
Reference in New Issue