Compare commits
2 Commits
fdroid-v1.
...
leap_of_fa
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9e0eb9303f | ||
|
|
e1aee3cfbd |
@@ -71,9 +71,9 @@ android {
|
||||
dimension "default"
|
||||
applicationIdSuffix ".dev"
|
||||
}
|
||||
face {
|
||||
offline {
|
||||
dimension "default"
|
||||
applicationIdSuffix ".face"
|
||||
applicationIdSuffix ".offline"
|
||||
}
|
||||
playstore {
|
||||
dimension "default"
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
<resources>
|
||||
<string name="app_name">Ente Face</string>
|
||||
<string name="backup">backup face</string>
|
||||
</resources>
|
||||
4
mobile/android/app/src/offline/res/values/strings.xml
Normal file
4
mobile/android/app/src/offline/res/values/strings.xml
Normal file
@@ -0,0 +1,4 @@
|
||||
<resources>
|
||||
<string name="app_name">Ente Offline</string>
|
||||
<string name="backup">backup Offline</string>
|
||||
</resources>
|
||||
@@ -78,8 +78,8 @@ class LocalSyncService {
|
||||
return _existingSync!.future;
|
||||
}
|
||||
_existingSync = Completer<void>();
|
||||
final int ownerID = Configuration.instance.getUserID()!;
|
||||
|
||||
final int ownerID = Configuration.instance.getUserID() ?? 0;
|
||||
|
||||
// We use a lock to prevent synchronisation to occur while it is downloading
|
||||
// as this introduces wrong entry in FilesDB due to race condition
|
||||
// This is a fix for https://github.com/ente-io/ente/issues/4296
|
||||
@@ -98,7 +98,8 @@ class LocalSyncService {
|
||||
);
|
||||
} else {
|
||||
// Load from 0 - 01.01.2010
|
||||
Bus.instance.fire(SyncStatusUpdate(SyncStatus.startedFirstGalleryImport));
|
||||
Bus.instance
|
||||
.fire(SyncStatusUpdate(SyncStatus.startedFirstGalleryImport));
|
||||
var startTime = 0;
|
||||
var toYear = 2010;
|
||||
var toTime = DateTime(toYear).microsecondsSinceEpoch;
|
||||
|
||||
@@ -5,6 +5,7 @@ import "package:battery_info/battery_info_plugin.dart";
|
||||
import "package:battery_info/model/android_battery_info.dart";
|
||||
import "package:battery_info/model/iso_battery_info.dart";
|
||||
import "package:logging/logging.dart";
|
||||
import "package:photos/core/configuration.dart";
|
||||
import "package:photos/core/event_bus.dart";
|
||||
import "package:photos/events/machine_learning_control_event.dart";
|
||||
|
||||
@@ -25,6 +26,9 @@ class MachineLearningController {
|
||||
bool get isDeviceHealthy => _isDeviceHealthy;
|
||||
|
||||
MachineLearningController() {
|
||||
if (Configuration.instance.getUserID() == null) {
|
||||
return;
|
||||
}
|
||||
_logger.info('MachineLearningController constructor');
|
||||
_startInteractionTimer(kDefaultInteractionTimeout);
|
||||
if (Platform.isIOS) {
|
||||
@@ -45,6 +49,9 @@ class MachineLearningController {
|
||||
}
|
||||
|
||||
void onUserInteraction() {
|
||||
if (Configuration.instance.getUserID() == null) {
|
||||
return;
|
||||
}
|
||||
if (!_isUserInteracting) {
|
||||
_logger.info("User is interacting with the app");
|
||||
_isUserInteracting = true;
|
||||
|
||||
@@ -77,7 +77,7 @@ class _HomeGalleryWidgetState extends State<HomeGalleryWidget> {
|
||||
final gallery = Gallery(
|
||||
key: ValueKey(_shouldHideSharedItems),
|
||||
asyncLoader: (creationStartTime, creationEndTime, {limit, asc}) async {
|
||||
final ownerID = Configuration.instance.getUserID();
|
||||
final ownerID = Configuration.instance.getUserID() ?? 0;
|
||||
final hasSelectedAllForBackup =
|
||||
Configuration.instance.hasSelectedAllFoldersForBackup();
|
||||
final collectionsToHide =
|
||||
@@ -89,7 +89,7 @@ class _HomeGalleryWidgetState extends State<HomeGalleryWidget> {
|
||||
ignoredCollectionIDs: collectionsToHide,
|
||||
ignoreSavedFiles: true,
|
||||
);
|
||||
if (hasSelectedAllForBackup) {
|
||||
if (hasSelectedAllForBackup || ownerID == 0) {
|
||||
result = await FilesDB.instance.getAllLocalAndUploadedFiles(
|
||||
creationStartTime,
|
||||
creationEndTime,
|
||||
|
||||
@@ -638,15 +638,18 @@ class _HomeWidgetState extends State<HomeWidget> {
|
||||
);
|
||||
}
|
||||
|
||||
bool isOfflineMode = true;
|
||||
Widget _getBody(BuildContext context) {
|
||||
if (!Configuration.instance.hasConfiguredAccount()) {
|
||||
if (!Configuration.instance.hasConfiguredAccount() && !isOfflineMode) {
|
||||
_closeDrawerIfOpen(context);
|
||||
return const LandingPageWidget();
|
||||
}
|
||||
if (!LocalSyncService.instance.hasGrantedPermissions()) {
|
||||
entityService.syncEntities().then((_) {
|
||||
PersonService.instance.resetEmailToPartialPersonDataCache();
|
||||
});
|
||||
if (isOfflineMode) {
|
||||
entityService.syncEntities().then((_) {
|
||||
PersonService.instance.resetEmailToPartialPersonDataCache();
|
||||
});
|
||||
}
|
||||
return const GrantPermissionsWidget();
|
||||
}
|
||||
if (!LocalSyncService.instance.hasCompletedFirstImport()) {
|
||||
@@ -672,7 +675,8 @@ class _HomeWidgetState extends State<HomeWidget> {
|
||||
_showShowBackupHook =
|
||||
!Configuration.instance.hasSelectedAnyBackupFolder() &&
|
||||
!LocalSyncService.instance.hasGrantedLimitedPermissions() &&
|
||||
CollectionsService.instance.getActiveCollections().isEmpty;
|
||||
CollectionsService.instance.getActiveCollections().isEmpty &&
|
||||
!isOfflineMode;
|
||||
|
||||
return Stack(
|
||||
children: [
|
||||
@@ -694,15 +698,17 @@ class _HomeWidgetState extends State<HomeWidget> {
|
||||
_showShowBackupHook
|
||||
? const StartBackupHookWidget(headerWidget: HeaderWidget())
|
||||
: HomeGalleryWidget(
|
||||
header: const HeaderWidget(),
|
||||
header: isOfflineMode
|
||||
? const SizedBox.shrink()
|
||||
: const HeaderWidget(),
|
||||
footer: const SizedBox(
|
||||
height: 160,
|
||||
),
|
||||
selectedFiles: _selectedFiles,
|
||||
),
|
||||
_userCollectionsTab,
|
||||
_sharedCollectionTab,
|
||||
_searchTab,
|
||||
if (!isOfflineMode) _userCollectionsTab,
|
||||
if (isOfflineMode) _sharedCollectionTab,
|
||||
if (!isOfflineMode) _searchTab,
|
||||
],
|
||||
);
|
||||
},
|
||||
@@ -745,10 +751,11 @@ class _HomeWidgetState extends State<HomeWidget> {
|
||||
),
|
||||
)
|
||||
: const SizedBox.shrink(),
|
||||
HomeBottomNavigationBar(
|
||||
_selectedFiles,
|
||||
selectedTabIndex: _selectedTabIndex,
|
||||
),
|
||||
if (!isOfflineMode)
|
||||
HomeBottomNavigationBar(
|
||||
_selectedFiles,
|
||||
selectedTabIndex: _selectedTabIndex,
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
@@ -3,6 +3,7 @@ import "dart:math";
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
import "package:photos/core/configuration.dart";
|
||||
import 'package:photos/core/event_bus.dart';
|
||||
import 'package:photos/events/collection_updated_event.dart';
|
||||
import 'package:photos/events/local_photos_updated_event.dart';
|
||||
@@ -71,6 +72,11 @@ class _SharedCollectionsTabState extends State<SharedCollectionsTab>
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (Configuration.instance.getUserID() == null) {
|
||||
return const Center(
|
||||
child: Text("Please login to view shared collections"),
|
||||
);
|
||||
}
|
||||
super.build(context);
|
||||
return FutureBuilder<SharedCollections>(
|
||||
future: Future.value(CollectionsService.instance.getSharedCollections()),
|
||||
|
||||
@@ -79,7 +79,7 @@ class _FileDetailsWidgetState extends State<FileDetailsWidget> {
|
||||
@override
|
||||
void initState() {
|
||||
debugPrint('file_details_sheet initState');
|
||||
_currentUserID = Configuration.instance.getUserID()!;
|
||||
_currentUserID = Configuration.instance.getUserID() ?? 0;
|
||||
hasLocationData.value = widget.file.hasLocation;
|
||||
_isImage = widget.file.fileType == FileType.image ||
|
||||
widget.file.fileType == FileType.livePhoto;
|
||||
|
||||
@@ -3,6 +3,7 @@ import "dart:async";
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:logging/logging.dart';
|
||||
import 'package:photos/core/cache/thumbnail_in_memory_cache.dart';
|
||||
import "package:photos/core/configuration.dart";
|
||||
import 'package:photos/core/constants.dart';
|
||||
import 'package:photos/core/errors.dart';
|
||||
import 'package:photos/core/event_bus.dart';
|
||||
@@ -119,6 +120,7 @@ class _ThumbnailWidgetState extends State<ThumbnailWidget> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
int? user = Configuration.instance.getUserID();
|
||||
if (widget.file.isRemoteFile) {
|
||||
_loadNetworkImage();
|
||||
} else {
|
||||
@@ -193,7 +195,9 @@ class _ThumbnailWidgetState extends State<ThumbnailWidget> {
|
||||
const ThumbnailPlaceHolder(),
|
||||
content ?? const SizedBox(),
|
||||
];
|
||||
if (widget.shouldShowSyncStatus && !widget.file.isUploaded) {
|
||||
if (widget.shouldShowSyncStatus &&
|
||||
!widget.file.isUploaded &&
|
||||
user != null) {
|
||||
viewChildren.add(const UnSyncedIcon());
|
||||
}
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ import "package:flutter/foundation.dart";
|
||||
import "package:flutter/material.dart";
|
||||
import "package:flutter_animate/flutter_animate.dart";
|
||||
import "package:logging/logging.dart";
|
||||
import "package:photos/core/configuration.dart";
|
||||
import "package:photos/generated/l10n.dart";
|
||||
import "package:photos/models/search/album_search_result.dart";
|
||||
import "package:photos/models/search/generic_search_result.dart";
|
||||
@@ -57,6 +58,10 @@ class _SearchTabState extends State<SearchTab> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
if (Configuration.instance.getUserID() == null) {
|
||||
return const Text("Not logged in");
|
||||
}
|
||||
|
||||
return AllSectionsExamplesProvider(
|
||||
child: FadeIndexedStack(
|
||||
lazy: false,
|
||||
|
||||
Reference in New Issue
Block a user