@@ -32,7 +32,7 @@ class HomeRouteState extends State<HomeRoute> {
3232 itemCount: snapshot.data! .length,
3333 child: (position) => HWListItem (
3434 homework: snapshot.data! [position],
35- onEdit: () async => showDialog (
35+ onEdit: () => showDialog (
3636 context: context,
3737 builder: (context) => HomeworkFormDialog (
3838 homework: snapshot.data! [position],
@@ -130,9 +130,7 @@ class HomeRouteState extends State<HomeRoute> {
130130 tooltip: locals.discordHomeworkFetchTitle,
131131 onPressed: ! DiscordHelper ().isLoggedIn
132132 ? null
133- : () => DiscordHelper ().fetchHomework ().then ((map) async {
134- /*void Function(String text) discordError =
135- (String text) => HWMToast(text: text, color: Colors.red, icon: const Icon(Icons.cloud_sync_outlined)).show();*/
133+ : () => DiscordHelper ().fetchHomework ().then ((map) {
136134 void fetchConfirmation (String text) =>
137135 HWMToast (text: text, color: Colors .green.shade900, icon: const Icon (Icons .cloud_sync_outlined)).show ();
138136 void fetchStatusUpdate (String text) =>
@@ -162,6 +160,9 @@ class HomeRouteState extends State<HomeRoute> {
162160 DBHelper .insertHWPages (pages.toList ());
163161 setState (() {});
164162 });
163+ }).catchError ((e,s) {
164+ // TODO: handle misconfiguration of permissions properly!
165+ discordError (e.toString ()); return null ;
165166 }),
166167 ),
167168 IconButton (
@@ -176,7 +177,7 @@ class HomeRouteState extends State<HomeRoute> {
176177 ),
177178 body: hwListWidget (),
178179 floatingActionButton: FloatingActionButton (
179- onPressed: () async => showDialog (
180+ onPressed: () => showDialog (
180181 context: context,
181182 builder: (context) => HomeworkFormDialog (
182183 title: context.locals.dialogHWAddTitle,
0 commit comments