chore: show snackbar on course edit save (#4025)

This commit is contained in:
ggurdin 2025-09-18 09:56:50 -04:00 committed by GitHub
parent eb3f5a446f
commit e3e8cc45fa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 23 additions and 5 deletions

View file

@ -5249,5 +5249,6 @@
"subscribeToUnlockTranscriptions": "Subscribe to unlock transcriptions",
"pingSent": "🔔 Course ping sent! 🔔",
"courseTitle": "Course title",
"courseDesc": "Course description"
"courseDesc": "Course description",
"courseSavedSuccessfully": "Course saved successfully"
}

View file

@ -60,6 +60,26 @@ class EditCourseController extends State<EditCourse> {
}
}
Future<void> _save() async {
final resp = await showFutureLoadingDialog(
context: context,
future: _saveChanges,
);
if (mounted) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(
content: Text(
resp.isError
? L10n.of(context).oopsSomethingWentWrong
: L10n.of(context).courseSavedSuccessfully,
textAlign: TextAlign.center,
),
),
);
}
}
Future<void> _setAvatarAction() async {
if (_room == null) return;
final actions = [
@ -220,10 +240,7 @@ class EditCourseController extends State<EditCourse> {
Container(
padding: const EdgeInsets.symmetric(vertical: 16.0),
child: ElevatedButton(
onPressed: () => showFutureLoadingDialog(
context: context,
future: _saveChanges,
),
onPressed: _save,
child: Row(
spacing: 8.0,
mainAxisAlignment: MainAxisAlignment.center,