some small fix for archive/leave button PR

pull/1183/head
ggurdin 1 year ago
parent 33de062a6e
commit 199e71159d

@ -454,11 +454,7 @@ class ChatController extends State<ChatPageWithRoom>
} }
} }
timeline!.requestKeys(onlineKeyBackupOnly: false); timeline!.requestKeys(onlineKeyBackupOnly: false);
if (!room.isSpace && if (room.markedUnread) room.markUnread(false);
room.membership == Membership.join &&
room.markedUnread) {
room.markUnread(false);
}
// when the scroll controller is attached we want to scroll to an event id, if specified // when the scroll controller is attached we want to scroll to an event id, if specified
// and update the scroll controller...which will trigger a request history, if the // and update the scroll controller...which will trigger a request history, if the

@ -229,7 +229,10 @@ class _SpaceViewState extends State<SpaceView> {
), ),
message: spaceChild?.topic ?? room?.topic, message: spaceChild?.topic ?? room?.topic,
actions: [ actions: [
// #Pangea
// if (room == null)
if (room == null || room.membership == Membership.leave) if (room == null || room.membership == Membership.leave)
// Pangea#
SheetAction( SheetAction(
key: SpaceChildContextAction.join, key: SpaceChildContextAction.join,
label: L10n.of(context)!.joinRoom, label: L10n.of(context)!.joinRoom,
@ -304,7 +307,6 @@ class _SpaceViewState extends State<SpaceView> {
} else { } else {
widget.controller.toggleSelection(room.id); widget.controller.toggleSelection(room.id);
await widget.controller.leaveAction(); await widget.controller.leaveAction();
widget.controller.toggleSelection(room.id);
} }
_refresh(); _refresh();
break; break;
@ -344,7 +346,6 @@ class _SpaceViewState extends State<SpaceView> {
} else { } else {
widget.controller.toggleSelection(room.id); widget.controller.toggleSelection(room.id);
await widget.controller.archiveAction(); await widget.controller.archiveAction();
widget.controller.toggleSelection(room.id);
} }
// Pangea# // Pangea#
_refresh(); _refresh();

@ -71,8 +71,8 @@ extension ClassAndExchangeSettingsRoomExtension on Room {
} }
final spaceChildPower = final spaceChildPower =
currentPowerContent["events"][EventTypes.spaceChild]; currentPowerContent["events"][EventTypes.spaceChild];
final studentAnalyticsPower = final studentAnalyticsPower = currentPowerContent["events"]
currentPowerContent[PangeaEventTypes.studentAnalyticsSummary]; [PangeaEventTypes.studentAnalyticsSummary];
if ((spaceChildPower == null || studentAnalyticsPower == null)) { if ((spaceChildPower == null || studentAnalyticsPower == null)) {
currentPowerContent["events"][EventTypes.spaceChild] = 0; currentPowerContent["events"][EventTypes.spaceChild] = 0;

Loading…
Cancel
Save