mirror of
https://gitlab.com/famedly/fluffychat.git
synced 2024-11-27 14:59:29 +01:00
Merge branch 'nico/fix-emote-rooms-without-default' into 'main'
fix: type error in emote pack list in rooms with only non-default packs Closes #1138 See merge request famedly/fluffychat!1098
This commit is contained in:
commit
f0ac88c9ee
@ -24,8 +24,11 @@ class MultipleEmotesSettingsView extends StatelessWidget {
|
|||||||
body: StreamBuilder(
|
body: StreamBuilder(
|
||||||
stream: room.onUpdate.stream,
|
stream: room.onUpdate.stream,
|
||||||
builder: (context, snapshot) {
|
builder: (context, snapshot) {
|
||||||
final Map<String, Event?> packs =
|
final packStateEvents = room.states['im.ponies.room_emotes'];
|
||||||
room.states['im.ponies.room_emotes'] ?? <String, Event>{};
|
// we need to manually convert the map using Map.of, otherwise assigning null will throw a type error.
|
||||||
|
final Map<String, Event?> packs = packStateEvents != null
|
||||||
|
? Map<String, Event?>.of(packStateEvents)
|
||||||
|
: <String, Event?>{};
|
||||||
if (!packs.containsKey('')) {
|
if (!packs.containsKey('')) {
|
||||||
packs[''] = null;
|
packs[''] = null;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user