From e542e8e39205d5e0b1c5eff0542d21d85312dabb Mon Sep 17 00:00:00 2001 From: Sun Date: Thu, 21 Oct 2021 16:05:00 +0800 Subject: [PATCH] GroupChat: fix create local group --- lib/apps/file/models.dart | 3 +++ lib/apps/group_chat/add.dart | 16 +++++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/lib/apps/file/models.dart b/lib/apps/file/models.dart index 2332298..6fb8587 100644 --- a/lib/apps/file/models.dart +++ b/lib/apps/file/models.dart @@ -108,6 +108,9 @@ const Map FILE_TYPES = { 'md': FileType.Markdown, 'mp4': FileType.Video, 'mp3': FileType.Music, + 'm4a': FileType.Music, + 'flac': FileType.Music, + 'wav': FileType.Music, }; enum FileType { diff --git a/lib/apps/group_chat/add.dart b/lib/apps/group_chat/add.dart index 91ab7fb..735beb4 100644 --- a/lib/apps/group_chat/add.dart +++ b/lib/apps/group_chat/add.dart @@ -204,13 +204,15 @@ class _GroupAddPageState extends State { } _create() { - if (!this._providers.containsKey(this._providerSelected)) { - return; - } - - final addr = this._providers[this._providerSelected]!.addr; - if (_groupLocation == 0 && addr.length < 2) { - return; + String addr = ''; + if (_groupLocation == 0) { + if (!this._providers.containsKey(this._providerSelected)) { + return; + } + addr = this._providers[this._providerSelected]!.addr; + if (addr.length < 2) { + return; + } } final name = _createNameController.text.trim(); final bio = _createBioController.text.trim();