fix: Minor fixes

This commit is contained in:
Christian Pauly 2020-11-23 14:27:10 +01:00
parent 0061660142
commit 11e2dd5c1b
2 changed files with 9 additions and 3 deletions

View File

@ -451,7 +451,8 @@ class _ChatState extends State<_Chat> {
if (_collapseRoomCreate &&
filteredEvents[filteredEvents.length - 1].type ==
EventTypes.RoomCreate) {
while (filteredEvents[filteredEvents.length - 2].senderId ==
while (filteredEvents.length >= 3 &&
filteredEvents[filteredEvents.length - 2].senderId ==
filteredEvents[filteredEvents.length - 1].senderId &&
![EventTypes.Message, EventTypes.Sticker, EventTypes.Encrypted]
.contains(filteredEvents[filteredEvents.length - 2].type)) {

View File

@ -121,15 +121,20 @@ class _SettingsState extends State<Settings> {
}
void setJitsiInstanceAction(BuildContext context) async {
const prefix = 'https://';
var input = await showTextInputDialog(
context: context,
title: L10n.of(context).editJitsiInstance,
textFields: [
DialogTextField(initialText: Matrix.of(context).jitsiInstance),
DialogTextField(
initialText:
Matrix.of(context).jitsiInstance.replaceFirst(prefix, ''),
prefixText: prefix,
),
],
);
if (input == null) return;
var jitsi = input.single;
var jitsi = prefix + input.single;
if (!jitsi.endsWith('/')) {
jitsi += '/';
}