Sentry (#1111)
* better error logging when requesting notifications permission * check that speech to text card in mounted before calling setState * only log first 10 entries in other category keys list
This commit is contained in:
parent
7e34f40a48
commit
401a26ef85
3 changed files with 32 additions and 20 deletions
|
|
@ -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(),
|
||||
},
|
||||
|
|
|
|||
|
|
@ -63,14 +63,12 @@ class MessageSpeechToTextCardState extends State<MessageSpeechToTextCard> {
|
|||
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<InlineSpan> spans = [];
|
||||
|
|
@ -114,13 +112,15 @@ class MessageSpeechToTextCardState extends State<MessageSpeechToTextCard> {
|
|||
..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;
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
),
|
||||
);
|
||||
|
|
|
|||
|
|
@ -163,14 +163,26 @@ class BackgroundPush {
|
|||
Set<String?>? 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 ??= <String>{};
|
||||
final pushers = await (client.getPushers().catchError((e) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue