Skip to content

Commit

Permalink
add some error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
dasmikko committed Feb 28, 2023
1 parent b98f1ad commit 99dbf71
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
1 change: 1 addition & 0 deletions fastlane/metadata/android/en-US/changelogs/82.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ New

Changes
* Move to the new API endpoint for posting.
* Remove twitter login

Fixes
* Profiles not loading (again...)
15 changes: 10 additions & 5 deletions lib/widgets/hiddenThreads/hiddenThreadListItem.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ class HiddenThreadListItem extends ThreadListItem {

@override
void onTapItem(BuildContext context) async {
// TODO: implement onTapItem
bool confirmResult = await (Get.dialog(ConfirmDialog(
content: "Do you want unhide the thread?",
)));
Expand All @@ -36,10 +35,16 @@ class HiddenThreadListItem extends ThreadListItem {
showProgressIndicator: true,
);

await KnockoutAPI().unhideThread(threadDetails!.id!);
snackbarController.close();
try {
await KnockoutAPI().unhideThread(threadDetails!.id!);
snackbarController.close();

KnockySnackbar.success('Thread is now unhidden!');
hiddenThreadsController.fetch();
KnockySnackbar.success('Thread is now unhidden!');
hiddenThreadsController.fetch();
} catch (e) {
snackbarController.close();

KnockySnackbar.error('Failed to unhide thread...');
}
}
}

0 comments on commit 99dbf71

Please sign in to comment.