diff --git a/lib/pangea/models/analytics/construct_list_model.dart b/lib/pangea/models/analytics/construct_list_model.dart index 0af074dfa..255eae4b4 100644 --- a/lib/pangea/models/analytics/construct_list_model.dart +++ b/lib/pangea/models/analytics/construct_list_model.dart @@ -129,7 +129,7 @@ class ConstructListModel { "others": others .map( (entry) => - ("${entry.key}: ${entry.value.map((uses) => uses.id.string).toList()}"), + ("${entry.key}: ${entry.value.map((uses) => uses.id.string).toList().sublist(0, 10)}"), ) .toList(), }, diff --git a/lib/pangea/widgets/chat/message_speech_to_text_card.dart b/lib/pangea/widgets/chat/message_speech_to_text_card.dart index 98996ba3a..725583c3c 100644 --- a/lib/pangea/widgets/chat/message_speech_to_text_card.dart +++ b/lib/pangea/widgets/chat/message_speech_to_text_card.dart @@ -63,14 +63,12 @@ class MessageSpeechToTextCardState extends State { data: widget.messageEvent.event.content, ); } finally { - setState(() => _fetchingTranscription = false); + if (mounted) { + setState(() => _fetchingTranscription = false); + } } } - void closeHint() { - setState(() {}); - } - TextSpan _buildTranscriptText(BuildContext context) { final Transcript transcript = speechToTextResponse!.transcript; final List spans = []; @@ -114,13 +112,15 @@ class MessageSpeechToTextCardState extends State { ..onTap = () { debugPrint('Token tapped'); debugPrint(token.toJson().toString()); - setState(() { - if (selectedToken == token) { - selectedToken = null; - } else { - selectedToken = token; - } - }); + if (mounted) { + setState(() { + if (selectedToken == token) { + selectedToken = null; + } else { + selectedToken = token; + } + }); + } }, ), ); diff --git a/lib/utils/background_push.dart b/lib/utils/background_push.dart index 093b78f81..884bde9ae 100644 --- a/lib/utils/background_push.dart +++ b/lib/utils/background_push.dart @@ -163,14 +163,26 @@ class BackgroundPush { Set? oldTokens, bool useDeviceSpecificAppId = false, }) async { - if (PlatformInfos.isIOS) { - await firebase?.requestPermission(); - } else if (PlatformInfos.isAndroid) { - _flutterLocalNotificationsPlugin - .resolvePlatformSpecificImplementation< - AndroidFlutterLocalNotificationsPlugin>() - ?.requestNotificationsPermission(); + // #Pangea + try { + // Pangea# + if (PlatformInfos.isIOS) { + await firebase?.requestPermission(); + } else if (PlatformInfos.isAndroid) { + _flutterLocalNotificationsPlugin + .resolvePlatformSpecificImplementation< + AndroidFlutterLocalNotificationsPlugin>() + ?.requestNotificationsPermission(); + } + // #Pangea + } catch (err, s) { + ErrorHandler.logError( + e: "Error requesting notifications permission: $err", + s: s, + ); } + // Pangea# + final clientName = PlatformInfos.clientName; oldTokens ??= {}; final pushers = await (client.getPushers().catchError((e) {