diff --git a/lib/app_shell.dart b/lib/app_shell.dart index 8ef7c90ca..b759fdc55 100644 --- a/lib/app_shell.dart +++ b/lib/app_shell.dart @@ -368,6 +368,8 @@ class MobileAppBar extends StatelessWidget implements PreferredSizeWidget { ), ), const Spacer(), + const GlobalHideToggleButton(), + const SizedBox(width: 8), const SyncButton(), const SizedBox( width: 24, diff --git a/lib/authentication/ardrive_auth.dart b/lib/authentication/ardrive_auth.dart index 426698304..0918bab9b 100644 --- a/lib/authentication/ardrive_auth.dart +++ b/lib/authentication/ardrive_auth.dart @@ -236,12 +236,12 @@ class ArDriveAuthImpl implements ArDriveAuth { await _secureKeyValueStore.remove('biometricEnabled'); currentUser = null; await _disconnectFromArConnect(); - _userStreamController.add(null); } await _userRepository.deleteUser(); await _databaseHelpers.deleteAllTables(); - await (await _metadataCache).clear(); + (await _metadataCache).clear(); + _userStreamController.add(null); } catch (e, stacktrace) { logger.e('Failed to logout user', e, stacktrace); throw AuthenticationFailedException('Failed to logout user'); diff --git a/lib/blocs/drive_detail/drive_detail_cubit.dart b/lib/blocs/drive_detail/drive_detail_cubit.dart index d0003bef0..7fd36f742 100644 --- a/lib/blocs/drive_detail/drive_detail_cubit.dart +++ b/lib/blocs/drive_detail/drive_detail_cubit.dart @@ -142,6 +142,10 @@ class DriveDetailCubit extends Cubit { ), _profileCubit.stream.startWith(ProfileCheckingAvailability()), (drive, folderContents, _) async { + if (isClosed) { + return; + } + await _syncCubit.waitCurrentSync(); if (drive == null) { diff --git a/lib/blocs/hide/hide_bloc.dart b/lib/blocs/hide/hide_bloc.dart index e9b4db8d8..ea22602e4 100644 --- a/lib/blocs/hide/hide_bloc.dart +++ b/lib/blocs/hide/hide_bloc.dart @@ -393,7 +393,8 @@ class HideBloc extends Bloc { performedAction: settings.isHidden ? RevisionAction.hide : RevisionAction.unhide, ); - await _driveDao.updateDrive(driveCompanion.toEntryCompanion()); + + await _driveDao.insertDriveRevision(driveCompanion); } }); } diff --git a/lib/models/drive_revision.dart b/lib/models/drive_revision.dart index 8f6e23d93..83f63351b 100644 --- a/lib/models/drive_revision.dart +++ b/lib/models/drive_revision.dart @@ -21,6 +21,7 @@ extension DriveRevisionCompanionExtensions on DriveRevisionsCompanion { privacy: privacy.value, customGQLTags: customGQLTags, customJsonMetadata: customJsonMetadata, + isHidden: isHidden, ); /// Returns a [NetworkTransactionsCompanion] representing the metadata transaction