Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[auth] code refactor

Aman Raj Singh Mourya3327b7513344
diff --git a/auth/lib/services/preference_service.dart b/auth/lib/services/preference_service.dart
index 4d5c1bd7ef..45a2cf0e66 100644
--- a/auth/lib/services/preference_service.dart
+++ b/auth/lib/services/preference_service.dart
@@ -27,7 +27,6 @@ class PreferenceService {
Future<void> init() async {
_prefs = await SharedPreferences.getInstance();
- await setAppInstallTime();
}
bool hasShownCoachMark() {
@@ -110,14 +109,9 @@ class PreferenceService {
if (_prefs.containsKey(kAppInstallTime)) {
return _prefs.getInt(kAppInstallTime)!;
} else {
- return DateTime.now().millisecondsSinceEpoch;
- }
- }
-
- Future<void> setAppInstallTime() async {
- if (!_prefs.containsKey(kAppInstallTime)) {
- final installedTimeinMillis = DateTime.now().millisecondsSinceEpoch;
- await _prefs.setInt(kAppInstallTime, installedTimeinMillis);
+ int installedTimeinMillis = DateTime.now().millisecondsSinceEpoch;
+ _prefs.setInt(kAppInstallTime, installedTimeinMillis).ignore();
+ return installedTimeinMillis;
}
}
}