Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/lib/backend/http/http_pool_manager.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ class HttpPoolManager {
lastError = TimeoutException('Request timeout');
} on SocketException catch (e) {
lastError = e;
} on HandshakeException catch (e) {
lastError = e;
} on http.ClientException catch (e) {
lastError = e;
} catch (e) {
Expand Down
12 changes: 9 additions & 3 deletions app/lib/pages/apps/app_detail/app_detail.dart
Original file line number Diff line number Diff line change
Expand Up @@ -126,16 +126,22 @@ class _AppDetailPageState extends State<AppDetailPage> {
/// Safely launches a URL with fallback from in-app browser to external browser.
/// Returns true if the URL was launched successfully, false otherwise.
Future<bool> _launchUrlSafely(Uri uri) async {
final supportsInAppBrowser = uri.scheme == 'http' || uri.scheme == 'https';

try {
await launchUrl(uri, mode: LaunchMode.inAppBrowserView);
if (supportsInAppBrowser) {
await launchUrl(uri, mode: LaunchMode.inAppBrowserView);
} else {
await launchUrl(uri, mode: LaunchMode.externalApplication);
}
return true;
} on PlatformException catch (e) {
} catch (e) {
Logger.warning('Failed to launch URL with in-app browser: $e');
// Fall back to external browser
try {
await launchUrl(uri, mode: LaunchMode.externalApplication);
return true;
} on PlatformException catch (e) {
} catch (e) {
Logger.warning('Failed to launch URL with external browser: $e');
if (mounted) {
ScaffoldMessenger.of(context).showSnackBar(
Expand Down
14 changes: 9 additions & 5 deletions app/lib/pages/onboarding/speech_profile_widget.dart
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class SpeechProfileWidget extends StatefulWidget {
class _SpeechProfileWidgetState extends State<SpeechProfileWidget> with TickerProviderStateMixin {
late AnimationController _questionAnimationController;
late Animation<double> _questionFadeAnimation;
SpeechProfileProvider? _speechProvider;

@override
void initState() {
Expand All @@ -54,12 +55,15 @@ class _SpeechProfileWidgetState extends State<SpeechProfileWidget> with TickerPr
}

@override
void dispose() {
final speechProvider = context.read<SpeechProfileProvider>();
void didChangeDependencies() {
super.didChangeDependencies();
_speechProvider ??= context.read<SpeechProfileProvider>();
}

speechProvider.forceCompletionTimer?.cancel();
speechProvider.forceCompletionTimer = null;
speechProvider.close();
@override
void dispose() {
_speechProvider?.forceCompletionTimer?.cancel();
_speechProvider?.forceCompletionTimer = null;

_scrollController.dispose();
_questionAnimationController.dispose();
Expand Down
6 changes: 5 additions & 1 deletion app/lib/pages/settings/settings_drawer.dart
Original file line number Diff line number Diff line change
Expand Up @@ -457,7 +457,11 @@ class _SettingsDrawerState extends State<SettingsDrawer> {
onTap: () async {
final Uri url = Uri.parse('https://help.omi.me/en/');
if (await canLaunchUrl(url)) {
await launchUrl(url, mode: LaunchMode.inAppBrowserView);
try {
await launchUrl(url, mode: LaunchMode.inAppBrowserView);
} catch (e) {
await launchUrl(url, mode: LaunchMode.externalApplication);
}
}
},
),
Expand Down
26 changes: 15 additions & 11 deletions app/lib/services/notifications/notification_service_basic.dart
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,21 @@ class _BasicNotificationService implements NotificationInterface {
if (!allowed) {
return;
}
_awesomeNotifications.createNotification(
content: NotificationContent(
id: id,
channelKey: channel.channelKey!,
actionType: ActionType.Default,
title: title,
body: body,
payload: payload,
notificationLayout: layout,
),
);
try {
await _awesomeNotifications.createNotification(
content: NotificationContent(
id: id,
channelKey: channel.channelKey!,
actionType: ActionType.Default,
title: title,
body: body,
payload: payload,
notificationLayout: layout,
),
);
} catch (e) {
Logger.debug('Failed to create notification (channel may be disabled): $e');
}
}

@override
Expand Down
26 changes: 15 additions & 11 deletions app/lib/services/notifications/notification_service_fcm.dart
Original file line number Diff line number Diff line change
Expand Up @@ -93,17 +93,21 @@ class _FCMNotificationService implements NotificationInterface {
if (!allowed) {
return;
}
_awesomeNotifications.createNotification(
content: NotificationContent(
id: id,
channelKey: channel.channelKey!,
actionType: ActionType.Default,
title: title,
body: body,
payload: payload,
notificationLayout: layout,
),
);
try {
await _awesomeNotifications.createNotification(
content: NotificationContent(
id: id,
channelKey: channel.channelKey!,
actionType: ActionType.Default,
title: title,
body: body,
payload: payload,
notificationLayout: layout,
),
);
} catch (e) {
Logger.debug('Failed to create notification (channel may be disabled): $e');
}
}

@override
Expand Down
1 change: 1 addition & 0 deletions app/lib/services/services.dart
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ class MicRecorderService implements IMicRecorderService {
@override
void stop() {
_recorder.stopRecorder();
_recorder.closeRecorder();
_controller.close();

// callback
Expand Down