fix: Archive does not update its state

This commit is contained in:
krille-chan 2023-10-29 10:59:07 +01:00
commit b42a565a9a
No known key found for this signature in database
5 changed files with 32 additions and 34 deletions

View file

@ -949,15 +949,6 @@ class ChatController extends State<ChatPageWithRoom> {
return sendEmojiAction(emoji.emoji);
}
void forgetRoom() async {
final result = await showFutureLoadingDialog(
context: context,
future: room.forget,
);
if (result.error != null) return;
context.go('/rooms/archive');
}
void typeEmoji(Emoji? emoji) {
if (emoji == null) return;
final text = sendController.text;

View file

@ -108,21 +108,7 @@ class ChatView extends StatelessWidget {
],
),
];
} else if (controller.isArchived) {
return [
Padding(
padding: const EdgeInsets.all(8.0),
child: TextButton.icon(
onPressed: controller.forgetRoom,
style: TextButton.styleFrom(
foregroundColor: Theme.of(context).colorScheme.error,
),
icon: const Icon(Icons.delete_forever_outlined),
label: Text(L10n.of(context)!.delete),
),
),
];
} else {
} else if (!controller.room.isArchived) {
return [
if (Matrix.of(context).voipPlugin != null &&
controller.room.isDirectChat)
@ -135,6 +121,7 @@ class ChatView extends StatelessWidget {
ChatSettingsPopupMenu(controller.room, true),
];
}
return [];
}
@override