fix: prevent users from creating spaces with empty names
This commit is contained in:
parent
68707e57b9
commit
6959d8be00
1 changed files with 7 additions and 0 deletions
|
|
@ -2,6 +2,7 @@ import 'dart:typed_data';
|
|||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
import 'package:flutter_gen/gen_l10n/l10n.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:matrix/matrix.dart' as sdk;
|
||||
import 'package:matrix/matrix.dart';
|
||||
|
|
@ -112,6 +113,12 @@ class NewGroupController extends State<NewGroup> {
|
|||
final client = Matrix.of(context).client;
|
||||
|
||||
try {
|
||||
if (nameController.text.trim().isEmpty &&
|
||||
createGroupType == CreateGroupType.space) {
|
||||
setState(() => error = L10n.of(context).pleaseFillOut);
|
||||
return;
|
||||
}
|
||||
|
||||
setState(() {
|
||||
loading = true;
|
||||
error = null;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue