mirror of
https://gitlab.com/comunic/comunicmobile
synced 2025-06-19 08:15:16 +00:00
Can delete group logo
This commit is contained in:
@ -261,7 +261,13 @@ class _GroupSettingsScreenState extends SafeState<GroupSettingsScreen> {
|
||||
SettingsTile(
|
||||
title: tr("Generate a new random logo"),
|
||||
onTap: _generateRandomLogo,
|
||||
)
|
||||
),
|
||||
|
||||
// Delete current logo
|
||||
SettingsTile(
|
||||
title: tr("Delete logo"),
|
||||
onTap: _deleteLogo,
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
@ -294,4 +300,20 @@ class _GroupSettingsScreenState extends SafeState<GroupSettingsScreen> {
|
||||
await GroupsHelper.uploadNewLogo(_groupSettings.id, bytes);
|
||||
_key.currentState.refresh();
|
||||
}
|
||||
|
||||
/// Delete previous group logo
|
||||
void _deleteLogo() async {
|
||||
try {
|
||||
if (!await showConfirmDialog(
|
||||
context: context,
|
||||
message: tr("Do you really want to delete the logo of this group ?")))
|
||||
return;
|
||||
|
||||
await GroupsHelper.deleteLogo(_groupSettings.id);
|
||||
_key.currentState.refresh();
|
||||
} catch (e, s) {
|
||||
print("Could not delete group logo! $e\n$s");
|
||||
showSimpleSnack(context, tr("Could not delete group logo!"));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user