Skip to content

armgit / ente

Public Imported from GitHub
0

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

Merge branch 'main' into album

AmanRajSinghMourya1f11b174e1b8
diff --cc mobile/apps/photos/lib/ui/tabs/home_widget.dart
index 0e0fe3ac53,91c279661c..1d3e472170
--- a/mobile/apps/photos/lib/ui/tabs/home_widget.dart
+++ b/mobile/apps/photos/lib/ui/tabs/home_widget.dart
@@@ -133,7 -130,7 +129,7 @@@ class _HomeWidgetState extends State<Ho
late StreamSubscription<TabChangedEvent> _tabChangedEventSubscription;
late StreamSubscription<SubscriptionPurchasedEvent>
-- _subscriptionPurchaseEvent;
++ _subscriptionPurchaseEvent;
late StreamSubscription<TriggerLogoutEvent> _triggerLogoutEvent;
late StreamSubscription<UserLoggedOutEvent> _loggedOutEvent;
late StreamSubscription<PermissionGrantedEvent> _permissionGrantedEvent;
@@@ -143,10 -140,9 +139,9 @@@
StreamSubscription? _publicAlbumLinkSubscription;
StreamSubscription<Uri?>? _authDeepLinkSubscription;
late StreamSubscription<HomepageSwipeToSelectInProgressEvent>
-- _homepageSwipeToSelectInProgressEventSubscription;
++ _homepageSwipeToSelectInProgressEventSubscription;
late StreamSubscription<ChristmasBannerEvent>
-- _christmasBannerEventSubscription;
++ _christmasBannerEventSubscription;
late StreamSubscription<AppModeChangedEvent> _appModeChangedEventSubscription;
final DiffFetcher _diffFetcher = DiffFetcher();
@@@ -193,10 -189,10 +188,11 @@@
}
}
});
-- _subscriptionPurchaseEvent =
-- Bus.instance.on<SubscriptionPurchasedEvent>().listen((event) {
-- setState(() {});
-- });
++ _subscriptionPurchaseEvent = Bus.instance
++ .on<SubscriptionPurchasedEvent>()
++ .listen((event) {
++ setState(() {});
++ });
_accountConfiguredEvent = Bus.instance.on<AccountConfiguredEvent>().listen((
event,
) {
@@@ -225,13 -221,13 +221,14 @@@
setState(() {});
}
});
-- _appModeChangedEventSubscription =
-- Bus.instance.on<AppModeChangedEvent>().listen((event) async {
-- if (mounted) {
-- setState(() {});
-- _scheduleChangeLogCheck(delay: const Duration(milliseconds: 250));
-- }
-- });
++ _appModeChangedEventSubscription = Bus.instance
++ .on<AppModeChangedEvent>()
++ .listen((event) async {
++ if (mounted) {
++ setState(() {});
++ _scheduleChangeLogCheck(delay: const Duration(milliseconds: 250));
++ }
++ });
_firstImportEvent = Bus.instance.on<SyncStatusUpdate>().listen((
event,
) async {
@@@ -258,24 -254,12 +255,13 @@@
});
}
});
-- _backupFoldersUpdatedEvent =
-- Bus.instance.on<BackupFoldersUpdatedEvent>().listen((event) async {
-- if (mounted) {
- setState(() {});
- }
- });
- _collectionUpdatedEvent = Bus.instance.on<CollectionUpdatedEvent>().listen((
- event,
- ) async {
- // only reset state if backup hook is shown. This is to ensure that
- // during first sync, we don't keep showing backup hook if user has
- // files
- if (mounted &&
- _showShowBackupHook &&
- event.type == EventType.addedOrUpdated) {
-- setState(() {});
-- }
-- });
++ _backupFoldersUpdatedEvent = Bus.instance
++ .on<BackupFoldersUpdatedEvent>()
++ .listen((event) async {
++ if (mounted) {
++ setState(() {});
++ }
++ });
_initDeepLinks();
updateService.shouldShowUpdateNotification().then((value) {
Future.delayed(Duration.zero, () {
@@@ -320,15 -304,15 +306,16 @@@
_homepageSwipeToSelectInProgressEventSubscription = Bus.instance
.on<HomepageSwipeToSelectInProgressEvent>()
.listen((inProgress) {
-- _swipeToSelectInProgressNotifier.value = inProgress.isInProgress;
-- });
++ _swipeToSelectInProgressNotifier.value = inProgress.isInProgress;
++ });
-- _christmasBannerEventSubscription =
-- Bus.instance.on<ChristmasBannerEvent>().listen((_) {
-- if (mounted) {
-- setState(() {});
-- }
-- });
++ _christmasBannerEventSubscription = Bus.instance
++ .on<ChristmasBannerEvent>()
++ .listen((_) {
++ if (mounted) {
++ setState(() {});
++ }
++ });
if (!isLocalGalleryMode && Configuration.instance.hasConfiguredAccount()) {
MemoryShareService.instance.listMemoryShares().ignore();
}
@@@ -395,7 -379,7 +382,8 @@@
}
// Check for action=join parameter to show join dialog
-- final shouldShowJoinDialog = uri.queryParameters['action'] == 'join' &&
++ final shouldShowJoinDialog =
++ uri.queryParameters['action'] == 'join' &&
Configuration.instance.isLoggedIn();
final dialog = createProgressDialog(context, "Loading...");
@@@ -430,33 -414,33 +418,33 @@@
unawaited(
CollectionsService.instance
.verifyPublicCollectionPassword(
-- context,
-- CryptoUtil.bin2base64(hashedPassword),
-- collection.id,
-- )
-- .then((result) async {
-- if (result) {
-- await dialog.show();
--
-- final List<EnteFile> sharedFiles =
-- await _diffFetcher.getPublicFiles(
context,
++ CryptoUtil.bin2base64(hashedPassword),
collection.id,
-- collection.pubMagicMetadata.asc ?? false,
-- );
-- await dialog.hide();
-- Navigator.of(context).pop();
--
-- await routeToPage(
-- context,
-- SharedPublicCollectionPage(
-- CollectionWithThumbnail(collection, null),
-- files: sharedFiles,
-- shouldShowJoinDialog: shouldShowJoinDialog,
-- ),
-- );
-- }
-- }),
++ )
++ .then((result) async {
++ if (result) {
++ await dialog.show();
++
++ final List<EnteFile> sharedFiles = await _diffFetcher
++ .getPublicFiles(
++ context,
++ collection.id,
++ collection.pubMagicMetadata.asc ?? false,
++ );
++ await dialog.hide();
++ Navigator.of(context).pop();
++
++ await routeToPage(
++ context,
++ SharedPublicCollectionPage(
++ CollectionWithThumbnail(collection, null),
++ files: sharedFiles,
++ shouldShowJoinDialog: shouldShowJoinDialog,
++ ),
++ );
++ }
++ }),
);
} catch (e, s) {
_logger.severe("Failed to decrypt password for album", e, s);
@@@ -566,15 -549,15 +553,16 @@@
void _initMediaShareSubscription() {
// For sharing images/public links coming from outside the app while the app is in the memory
-- _intentDataStreamSubscription =
-- ReceiveSharingIntent.instance.getMediaStream().listen(
-- (List<SharedMediaFile> value) {
-- unawaited(_handleSharedMediaStream(value));
-- },
-- onError: (err) {
-- _logger.severe("getIntentDataStream error: $err");
-- },
-- );
++ _intentDataStreamSubscription = ReceiveSharingIntent.instance
++ .getMediaStream()
++ .listen(
++ (List<SharedMediaFile> value) {
++ unawaited(_handleSharedMediaStream(value));
++ },
++ onError: (err) {
++ _logger.severe("getIntentDataStream error: $err");
++ },
++ );
// For sharing images/public links coming from outside the app while the app is closed
ReceiveSharingIntent.instance.getInitialMedia().then((
List<SharedMediaFile> value,
@@@ -813,14 -796,14 +801,15 @@@
final action = AppLifecycleService.instance.mediaExtensionAction.action;
final isOnOnlineGrantPermissionScreen =
Configuration.instance.hasConfiguredAccount() &&
-- !isLocalGalleryMode &&
-- _shouldShowPermissionWidget();
++ !isLocalGalleryMode &&
++ _shouldShowPermissionWidget();
return UserDetailsStateWidget(
child: PopScope(
canPop: false,
onPopInvokedWithResult: (didPop, _) async {
if (didPop) return;
-- final isStartWithoutAccountFlow = widget.startWithoutAccount &&
++ final isStartWithoutAccountFlow =
++ widget.startWithoutAccount &&
!Configuration.instance.hasConfiguredAccount() &&
!localSettings.isAppModeSet;
if (isStartWithoutAccountFlow) {
@@@ -926,26 -909,26 +915,27 @@@
builder: (context, _) {
final colorScheme = getEnteColorScheme(context);
final resultsBackground = EnteTheme.isDark(context)
- ? const Color.fromRGBO(22, 22, 22, 1)
+ ? colorScheme.backgroundColour
: colorScheme.backgroundElevated2;
-- final isSearchResults = isOnSearchTab &&
++ final isSearchResults =
++ isOnSearchTab &&
IndexOfStackNotifier().index == 1;
final isOnLandingPage =
!Configuration.instance.hasConfiguredAccount() &&
-- !isLocalGalleryMode &&
-- !widget.startWithoutAccount;
++ !isLocalGalleryMode &&
++ !widget.startWithoutAccount;
final isOnOnlineGrantPermissionScreen =
Configuration.instance.hasConfiguredAccount() &&
-- !isLocalGalleryMode &&
-- _shouldShowPermissionWidget();
++ !isLocalGalleryMode &&
++ _shouldShowPermissionWidget();
return AppBar(
backgroundColor: isOnLandingPage
? colorScheme.greenBase
: isSearchResults
-- ? resultsBackground
-- : isOnOnlineGrantPermissionScreen
-- ? colorScheme.backgroundColour
- : colorScheme.backgroundColour,
- : colorScheme.backgroundBase,
++ ? resultsBackground
++ : isOnOnlineGrantPermissionScreen
++ ? colorScheme.backgroundColour
++ : colorScheme.backgroundColour,
);
},
);
@@@ -966,7 -949,7 +956,8 @@@
widget.startWithoutAccount && !localGalleryMode;
final hasPersistedLocalGalleryMode =
localSettings.isAppModeSet && localGalleryMode;
-- final canResumePersistedLocalGalleryMode = hasPersistedLocalGalleryMode &&
++ final canResumePersistedLocalGalleryMode =
++ hasPersistedLocalGalleryMode &&
permissionService.hasGrantedPermissions();
final shouldUseLocalGalleryEntryFlow =
widget.startWithoutAccount || canResumePersistedLocalGalleryMode;
@@@ -1030,13 -1011,9 +1019,9 @@@
? const NeverScrollableScrollPhysics()
: const BouncingScrollPhysics(),
children: [
- _showShowBackupHook
- ? const StartBackupHookWidget(
- headerWidget: HeaderWidget(),
- )
- : child!,
+ child!,
- UserCollectionsTab(selectedAlbums: _selectedAlbums),
- _sharedCollectionTab,
+ AlbumsTab(selectedAlbums: _selectedAlbums),
+ _feedTab,
_searchTab,
],
);
@@@ -1292,8 -1269,8 +1277,8 @@@
}
bool _shouldEnableDrawer() {
-- final isFirstImportCompleted =
-- LocalSyncService.instance.hasCompletedFirstImportOrBypassed();
++ final isFirstImportCompleted = LocalSyncService.instance
++ .hasCompletedFirstImportOrBypassed();
return isFirstImportCompleted;
}