mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
chore: add unwaited futures to analysis options (#4485)
This commit is contained in:
@ -28,7 +28,7 @@ class MenuUserBloc extends Bloc<MenuUserEvent, MenuUserState> {
|
||||
Future<void> close() async {
|
||||
await _userListener.stop();
|
||||
await _userWorkspaceListener.stop();
|
||||
super.close();
|
||||
return super.close();
|
||||
}
|
||||
|
||||
void _dispatch() {
|
||||
|
@ -68,7 +68,7 @@ class AppearanceSettingsCubit extends Cubit<AppearanceSettingsState> {
|
||||
/// with the AppTheme named [themeName].
|
||||
Future<void> setTheme(String themeName) async {
|
||||
_appearanceSettings.theme = themeName;
|
||||
_saveAppearanceSettings();
|
||||
unawaited(_saveAppearanceSettings());
|
||||
emit(state.copyWith(appTheme: await AppTheme.fromName(themeName)));
|
||||
}
|
||||
|
||||
@ -236,25 +236,21 @@ class AppearanceSettingsCubit extends Cubit<AppearanceSettingsState> {
|
||||
}
|
||||
|
||||
Future<void> _saveDateTimeSettings() async {
|
||||
UserSettingsBackendService()
|
||||
.setDateTimeSettings(_dateTimeSettings)
|
||||
.then((result) {
|
||||
result.fold(
|
||||
(error) => Log.error(error),
|
||||
(_) => null,
|
||||
);
|
||||
});
|
||||
final result = await UserSettingsBackendService()
|
||||
.setDateTimeSettings(_dateTimeSettings);
|
||||
result.fold(
|
||||
(error) => Log.error(error),
|
||||
(_) => null,
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> _saveAppearanceSettings() async {
|
||||
UserSettingsBackendService()
|
||||
.setAppearanceSetting(_appearanceSettings)
|
||||
.then((result) {
|
||||
result.fold(
|
||||
(l) => null,
|
||||
(error) => Log.error(error),
|
||||
);
|
||||
});
|
||||
final result = await UserSettingsBackendService()
|
||||
.setAppearanceSetting(_appearanceSettings);
|
||||
result.fold(
|
||||
(l) => null,
|
||||
(error) => Log.error(error),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@ class AppFlowyCloudSettingBloc
|
||||
|
||||
@override
|
||||
Future<void> close() async {
|
||||
_listener.stop();
|
||||
await _listener.stop();
|
||||
return super.close();
|
||||
}
|
||||
|
||||
|
@ -44,7 +44,7 @@ class ApplicationDataStorage {
|
||||
await directory.create(recursive: true);
|
||||
}
|
||||
|
||||
setPath(path);
|
||||
await setPath(path);
|
||||
}
|
||||
|
||||
Future<void> setPath(String path) async {
|
||||
|
@ -38,20 +38,18 @@ class NotificationSettingsCubit extends Cubit<NotificationSettingsState> {
|
||||
),
|
||||
);
|
||||
|
||||
_saveNotificationSettings();
|
||||
await _saveNotificationSettings();
|
||||
}
|
||||
|
||||
Future<void> _saveNotificationSettings() async {
|
||||
await _initCompleter.future;
|
||||
|
||||
UserSettingsBackendService()
|
||||
.setNotificationSettings(_notificationSettings)
|
||||
.then((result) {
|
||||
result.fold(
|
||||
(error) => Log.error(error),
|
||||
(r) => null,
|
||||
);
|
||||
});
|
||||
final result = await UserSettingsBackendService()
|
||||
.setNotificationSettings(_notificationSettings);
|
||||
result.fold(
|
||||
(error) => Log.error(error),
|
||||
(r) => null,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -25,11 +25,11 @@ class SettingFileImportBloc
|
||||
emit(
|
||||
state.copyWith(loadingState: const LoadingState.loading()),
|
||||
);
|
||||
UserEventImportAppFlowyDataFolder(payload).send().then((result) {
|
||||
if (!isClosed) {
|
||||
add(SettingFileImportEvent.finishImport(result));
|
||||
}
|
||||
});
|
||||
final result =
|
||||
await UserEventImportAppFlowyDataFolder(payload).send();
|
||||
if (!isClosed) {
|
||||
add(SettingFileImportEvent.finishImport(result));
|
||||
}
|
||||
},
|
||||
finishImport: (result) {
|
||||
result.fold(
|
||||
|
@ -32,7 +32,7 @@ class SettingsDialogBloc
|
||||
@override
|
||||
Future<void> close() async {
|
||||
await _userListener.stop();
|
||||
super.close();
|
||||
await super.close();
|
||||
}
|
||||
|
||||
void _dispatch() {
|
||||
|
@ -26,7 +26,7 @@ class SupabaseCloudSettingBloc
|
||||
|
||||
@override
|
||||
Future<void> close() async {
|
||||
_listener.stop();
|
||||
await _listener.stop();
|
||||
return super.close();
|
||||
}
|
||||
|
||||
@ -50,7 +50,7 @@ class SupabaseCloudSettingBloc
|
||||
},
|
||||
enableSync: (bool enable) async {
|
||||
final update = UpdateCloudConfigPB.create()..enableSync = enable;
|
||||
updateCloudConfig(update);
|
||||
await updateCloudConfig(update);
|
||||
},
|
||||
didReceiveSetting: (CloudSettingPB setting) {
|
||||
emit(
|
||||
|
@ -24,7 +24,7 @@ class SettingsUserViewBloc extends Bloc<SettingsUserEvent, SettingsUserState> {
|
||||
@override
|
||||
Future<void> close() async {
|
||||
await _userListener.stop();
|
||||
super.close();
|
||||
return super.close();
|
||||
}
|
||||
|
||||
void _dispatch() {
|
||||
|
@ -134,7 +134,7 @@ class ViewBloc extends Bloc<ViewEvent, ViewState> {
|
||||
(error) => state.copyWith(successOrFailure: right(error)),
|
||||
),
|
||||
);
|
||||
RecentService().updateRecentViews([view.id], false);
|
||||
await RecentService().updateRecentViews([view.id], false);
|
||||
},
|
||||
duplicate: (e) async {
|
||||
final result = await ViewBackendService.duplicate(view: view);
|
||||
|
Reference in New Issue
Block a user