fix: Archive does not update its state
This commit is contained in:
parent
9d29f9dcd2
commit
b42a565a9a
5 changed files with 32 additions and 34 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue