Offline Support
This commit is contained in:
@@ -57,9 +57,12 @@ class _AnnouncementCommentsSectionState
|
||||
}
|
||||
} catch (e) {
|
||||
if (mounted) {
|
||||
ScaffoldMessenger.of(context).showSnackBar(
|
||||
SnackBar(content: Text('Failed to post comment: $e')),
|
||||
);
|
||||
if (isOfflineSaveError(e)) {
|
||||
_controller.clear();
|
||||
showSuccessSnackBar(context, 'Comment saved offline — will sync when connected.');
|
||||
} else {
|
||||
showErrorSnackBar(context, 'Failed to post comment: $e');
|
||||
}
|
||||
}
|
||||
} finally {
|
||||
if (mounted) setState(() => _sending = false);
|
||||
|
||||
Reference in New Issue
Block a user