Skip to content

Commit

Permalink
feat: add translation error handling (#516)
Browse files Browse the repository at this point in the history
* feat: add translation error handling on notice edit body page

* feat: add translation error handling on notice write body page

* refactor: remove try catch

* refactor: Boseong's personal preference

* chore: version update 4.1.4
  • Loading branch information
GwanLiZa authored Nov 16, 2024
1 parent 2a3d90c commit 5ec35b1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -288,12 +288,14 @@ class _LayoutState extends State<_Layout> with SingleTickerProviderStateMixin {
lang: Language.en,
));
final result = await blocker;
if (!mounted) return;
result.mapOrNull(
loaded: (result) {
AnalyticsRepository.action(
const AnalyticsEvent.noticeEditBodyUseAiTranslation());
return _englishBodyController.html = result.body;
},
error: (error) => context.showToast(error.message),
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,7 @@ class _LayoutState extends State<_Layout> with SingleTickerProviderStateMixin {
final result = await blocker;
result.mapOrNull(
loaded: (result) => _englishBodyController.html = result.body,
error: (error) => context.showToast(error.message),
);
}

Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: ziggle
description: ziggle
publish_to: 'none'
version: 4.1.3
version: 4.1.4

environment:
sdk: ^3.5.1
Expand Down

0 comments on commit 5ec35b1

Please sign in to comment.