Skip to content

armgit / ente

Public Imported from GitHub
0

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

chore(Sidebar):minor-function-updation

Aswin Asok92336e206e18
diff --git a/web/apps/photos/src/components/Sidebar.tsx b/web/apps/photos/src/components/Sidebar.tsx
index c4754554dd..5bd5110087 100644
--- a/web/apps/photos/src/components/Sidebar.tsx
+++ b/web/apps/photos/src/components/Sidebar.tsx
@@ -275,22 +275,11 @@ export const Sidebar: React.FC<SidebarProps> = ({
[setWatchFolderView],
);
- const showCollectionSummaryWithWorkarounds = useCallback(
- (collectionSummaryID: number, isHidden?: boolean) => {
- const action = onShowCollectionSummary(
- collectionSummaryID,
- isHidden,
- );
- return isHidden ? action.then(() => wait(10)) : action;
- },
- [onShowCollectionSummary],
- );
-
const performSidebarAction = useCallback(
async (actionID: SidebarActionID) =>
performSidebarRegistryAction(actionID, {
onClose,
- onShowCollectionSummary: showCollectionSummaryWithWorkarounds,
+ onShowCollectionSummary,
onShowPlanSelector,
showAccount,
showPreferences,
@@ -318,7 +307,7 @@ export const Sidebar: React.FC<SidebarProps> = ({
handleLogout,
handleOpenWatchFolder,
onClose,
- showCollectionSummaryWithWorkarounds,
+ onShowCollectionSummary,
onShowPlanSelector,
onShowExport,
router,
diff --git a/web/packages/new/photos/services/search/sidebar-search-registry.ts b/web/packages/new/photos/services/search/sidebar-search-registry.ts
index df8a1663c4..d5c7c36c14 100644
--- a/web/packages/new/photos/services/search/sidebar-search-registry.ts
+++ b/web/packages/new/photos/services/search/sidebar-search-registry.ts
@@ -1,5 +1,6 @@
import { isDesktop } from "ente-base/app";
import { isHLSGenerationSupported } from "ente-gallery/services/video";
+import { wait } from "ente-utils/promise";
import { t } from "i18next";
import { isMLSupported } from "../ml";
import { isDevBuildAndUser } from "../settings";
@@ -292,9 +293,13 @@ export const performSidebarAction = async (
.onShowCollectionSummary(ctx.pseudoIDs.archive, false)
.then(() => ctx.onClose());
case "shortcuts.hidden":
- return ctx
- .onShowCollectionSummary(ctx.pseudoIDs.hidden, true)
- .then(() => ctx.onClose());
+ return (
+ ctx
+ .onShowCollectionSummary(ctx.pseudoIDs.hidden, true)
+ // See: [Note: Workarounds for unactionable ARIA warnings]
+ .then(() => wait(10))
+ .then(ctx.onClose)
+ );
case "shortcuts.trash":
return ctx
.onShowCollectionSummary(ctx.pseudoIDs.trash, false)