feat: make server owner of tabs
This commit is contained in:
@@ -10,7 +10,6 @@ import '../models/payment_method.dart';
|
||||
import '../models/product.dart';
|
||||
import '../models/tab_item.dart';
|
||||
import '../services/bar_tab_service.dart';
|
||||
import '../services/product_service.dart';
|
||||
|
||||
/// Tabs come from a database stream, so every change (local or remote) shows
|
||||
/// up without manual reloads. Actions report to Sentry and rethrow; the view
|
||||
@@ -129,12 +128,9 @@ class BarScreenViewModel extends ChangeNotifier {
|
||||
);
|
||||
}
|
||||
|
||||
/// Running out of stock is an expected outcome, not a bug worth reporting.
|
||||
Future<T> _guard<T>(String action, Future<T> Function() body) async {
|
||||
try {
|
||||
return await body();
|
||||
} on InsufficientStockException {
|
||||
rethrow;
|
||||
} catch (e, stack) {
|
||||
debugPrint('BarScreenViewModel: $action error: $e');
|
||||
unawaited(Sentry.captureException(e, stackTrace: stack));
|
||||
|
||||
Reference in New Issue
Block a user