Skip to content

Commit

Permalink
chore: remove await
Browse files Browse the repository at this point in the history
  • Loading branch information
appflowy committed Jun 24, 2024
1 parent 818d4a4 commit f4c1f13
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ class _AutoCompletionBlockComponentState
final userProfile = await UserBackendService.getCurrentUserProfile()
.then((value) => value.toNullable());
if (userProfile == null) {
await loading.stop();
loading.stop();
if (mounted) {
showSnackBarMessage(
context,
Expand All @@ -211,7 +211,7 @@ class _AutoCompletionBlockComponentState
text: controller.text,
completionType: CompletionTypePB.ContinueWriting,
onStart: () async {
await loading.stop();
loading.stop();
if (mounted) {
barrierDialog = BarrierDialog(context);
barrierDialog?.show();
Expand All @@ -228,7 +228,7 @@ class _AutoCompletionBlockComponentState
await barrierDialog?.dismiss();
},
onError: (error) async {
await loading.stop();
loading.stop();
if (mounted) {
showSnackBarMessage(
context,
Expand Down Expand Up @@ -285,7 +285,7 @@ class _AutoCompletionBlockComponentState
final userProfile = await UserBackendService.getCurrentUserProfile()
.then((value) => value.toNullable());
if (userProfile == null) {
await loading.stop();
loading.stop();
if (mounted) {
showSnackBarMessage(
context,
Expand All @@ -301,7 +301,7 @@ class _AutoCompletionBlockComponentState
text: _rewritePrompt(previousOutput),
completionType: CompletionTypePB.ContinueWriting,
onStart: () async {
await loading.stop();
loading.stop();
await _makeSurePreviousNodeIsEmptyParagraphNode();
},
onProcess: (text) async {
Expand All @@ -312,7 +312,7 @@ class _AutoCompletionBlockComponentState
},
onEnd: () async {},
onError: (error) async {
await loading.stop();
loading.stop();
if (mounted) {
showSnackBarMessage(
context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Loading {
),
);

Future<void> stop() async {
void stop() {
if (loadingContext != null) {
Navigator.of(loadingContext!).pop();
loadingContext = null;
Expand Down

0 comments on commit f4c1f13

Please sign in to comment.