Merge pull request #664 from ente-io/bug_fixes

Minor improvements and fixes
This commit is contained in:
Ashil 2022-11-23 11:24:29 +05:30 committed by GitHub
commit 1417ceac5a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 15 additions and 5 deletions

View file

@ -279,10 +279,14 @@ class RemoteSyncService {
localIDsToSync.removeAll(alreadyClaimedLocalIDs);
}
if (localIDsToSync.isEmpty || deviceCollection.collectionID == -1) {
if (localIDsToSync.isEmpty) {
continue;
}
await _createCollectionForDevicePath(deviceCollection);
if (deviceCollection.collectionID == -1) {
_logger.finest('DeviceCollection should not be -1 here');
continue;
}
moreFilesMarkedForBackup = true;
await _db.setCollectionIDForUnMappedLocalFiles(

View file

@ -54,7 +54,13 @@ class UserService {
emailValueNotifier =
ValueNotifier<String>(Configuration.instance.getEmail());
_preferences = await SharedPreferences.getInstance();
setTwoFactor(fetchTwoFactorStatus: true).ignore();
if (Configuration.instance.isLoggedIn()) {
// add artificial delay in refreshing 2FA status
Future.delayed(
const Duration(seconds: 5),
() => {setTwoFactor(fetchTwoFactorStatus: true).ignore()},
);
}
Bus.instance.on<TwoFactorStatusChangeEvent>().listen((event) {
setTwoFactor(value: event.status);
});

View file

@ -26,7 +26,7 @@ class ToggleSwitchWidget extends StatefulWidget {
}
class _ToggleSwitchWidgetState extends State<ToggleSwitchWidget> {
late bool toggleValue;
bool? toggleValue;
ExecutionState executionState = ExecutionState.idle;
final _debouncer = Debouncer(const Duration(milliseconds: 300));
@ -60,7 +60,7 @@ class _ToggleSwitchWidgetState extends State<ToggleSwitchWidget> {
activeColor: enteColorScheme.primary400,
inactiveTrackColor: enteColorScheme.fillMuted,
materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
value: toggleValue,
value: toggleValue ?? false,
onChanged: (negationOfToggleValue) async {
setState(() {
toggleValue = negationOfToggleValue;
@ -96,7 +96,7 @@ class _ToggleSwitchWidgetState extends State<ToggleSwitchWidget> {
});
}
} else {
toggleValue = !toggleValue;
toggleValue = !toggleValue!;
executionState = ExecutionState.idle;
}
});