Skip to content

armgit / ente

Public Imported from GitHub
0

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

Open Space post notifications directly and fix viewer close navigation

Anand Baburajan5d3b7c4da249
diff --git a/web/apps/space/src/pages/app/posts/[spaceId]/[postId].tsx b/web/apps/space/src/pages/app/posts/[spaceId]/[postId].tsx
index e38c906234..eb8b3954c6 100644
--- a/web/apps/space/src/pages/app/posts/[spaceId]/[postId].tsx
+++ b/web/apps/space/src/pages/app/posts/[spaceId]/[postId].tsx
@@ -15,7 +15,7 @@ import {
} from "services/space";
import { useSpaceAppState } from "state/app-state";
import { spaceAppBackgroundColor } from "styles/colors";
-import { useSpaceRouter } from "utils/route-transitions";
+import { hasPreviousSpaceRoute, useSpaceRouter } from "utils/route-transitions";
import { spaceRoutes } from "utils/routes";
const postBackground = "#000000";
@@ -145,12 +145,12 @@ const Page: React.FC = () => {
}, [post?.spaceId, post?.username, profile?.spaceId, router, spaceId]);
const closePost = React.useCallback(() => {
- if (typeof window != "undefined" && window.history.length > 1) {
+ if (hasPreviousSpaceRoute()) {
router.back();
return;
}
- openOwnerProfile();
- }, [openOwnerProfile, router]);
+ void router.replace(spaceRoutes.home);
+ }, [router]);
if (
!router.isReady ||