Skip to content

Commit

Permalink
Show snackbar instead of dialog for openglass support (#1552)
Browse files Browse the repository at this point in the history
Closes #1545
  • Loading branch information
mdmohsin7 authored Dec 17, 2024
2 parents 97b1003 + 226417a commit e107dbe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
12 changes: 0 additions & 12 deletions app/lib/pages/onboarding/find_device/found_devices.dart
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,6 @@ class _FoundDevicesState extends State<FoundDevices> {
// (route) => false,
// );
Navigator.pop(context);
} else if (info == 'OPENGLASS_NOT_SUPPORTED') {
showDialog(
context: context,
builder: (context) {
return getDialog(context, () {
Navigator.pop(context);
}, () {
Navigator.pop(context);
}, "OpenGlass isn't supported",
"OpenGlass isn’t available in this version of the app. It will be added in a future update once it's ready",
singleButton: true);
});
} else {
ScaffoldMessenger.of(context).showSnackBar(SnackBar(
content: Text(info),
Expand Down
5 changes: 4 additions & 1 deletion app/lib/providers/onboarding_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import 'package:friend_private/providers/device_provider.dart';
import 'package:friend_private/services/devices.dart';
import 'package:friend_private/services/notifications.dart';
import 'package:friend_private/services/services.dart';
import 'package:friend_private/utils/alerts/app_snackbar.dart';
import 'package:friend_private/utils/analytics/analytics_manager.dart';
import 'package:friend_private/utils/audio/foreground.dart';
import 'package:permission_handler/permission_handler.dart';
Expand Down Expand Up @@ -148,7 +149,9 @@ class OnboardingProvider extends BaseProvider with MessageNotifierMixin implemen
VoidCallback? goNext,
}) async {
if (device.name.toLowerCase() == 'openglass' || device.type == DeviceType.openglass) {
notifyInfo('OPENGLASS_NOT_SUPPORTED');
// notifyInfo('OPENGLASS_NOT_SUPPORTED');
AppSnackbar.showSnackbarError(
'OpenGlass is not supported at the moment. Support will be added in a future update');
return;
}
try {
Expand Down

0 comments on commit e107dbe

Please sign in to comment.