Skip to content

Commit 072e571

Browse files
committed
fix redirect
1 parent b985fca commit 072e571

File tree

1 file changed

+5
-37
lines changed

1 file changed

+5
-37
lines changed

web/frontend/src/app/wrapped/page.tsx

Lines changed: 5 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
import { headers } from 'next/headers';
2-
import { redirect } from 'next/navigation';
32
import { Metadata } from 'next';
4-
import envConfig from '@/src/constants/envConfig';
53

64
export const metadata: Metadata = {
75
title: 'Your 2025 Wrapped | Omi',
8-
description: 'See your personalized Omi Wrapped for 2025. Discover your memories, conversations, and highlights from the year.',
6+
description:
7+
'See your personalized Omi Wrapped for 2025. Discover your memories, conversations, and highlights from the year.',
98
openGraph: {
109
title: 'Your 2025 Wrapped | Omi',
1110
description: 'See your personalized Omi Wrapped for 2025.',
@@ -17,11 +16,6 @@ function isMobileDevice(userAgent: string): boolean {
1716
return /android|iphone|ipad|ipod|mobile/i.test(userAgent);
1817
}
1918

20-
function getDeepLink(): string {
21-
// Use Universal Link format
22-
return 'https://h.omi.me/wrapped';
23-
}
24-
2519
function getAppStoreLink(userAgent: string): string {
2620
const isAndroid = /android/i.test(userAgent);
2721
return isAndroid
@@ -32,7 +26,6 @@ function getAppStoreLink(userAgent: string): string {
3226
export default async function WrappedPage() {
3327
const userAgent = headers().get('user-agent') || '';
3428
const isMobile = isMobileDevice(userAgent);
35-
const deepLink = getDeepLink();
3629
const appStoreLink = getAppStoreLink(userAgent);
3730

3831
return (
@@ -44,42 +37,17 @@ export default async function WrappedPage() {
4437

4538
{isMobile ? (
4639
<>
47-
{/* Auto-redirect script for mobile */}
48-
<script
49-
dangerouslySetInnerHTML={{
50-
__html: `
51-
(function() {
52-
var deepLink = "${deepLink}";
53-
var appStoreLink = "${appStoreLink}";
54-
55-
// Try to open the app via deep link
56-
window.location.href = deepLink;
57-
58-
// Fallback to app store after a delay if app doesn't open
59-
setTimeout(function() {
60-
window.location.href = appStoreLink;
61-
}, 2500);
62-
})();
63-
`,
64-
}}
65-
/>
66-
<a
67-
href={deepLink}
68-
className="mb-4 rounded-xl bg-white px-8 py-4 text-lg font-semibold text-[#0B0F17] transition-all duration-300 hover:bg-gray-200"
69-
>
70-
Open in Omi App
71-
</a>
7240
<a
7341
href={appStoreLink}
74-
className="text-sm text-gray-400 underline hover:text-white"
42+
className="mb-4 rounded-xl bg-white px-8 py-4 text-lg font-semibold text-[#0B0F17] transition-all duration-300 hover:bg-gray-200"
7543
>
76-
Don&apos;t have the app? Download it here
44+
Get the Omi App
7745
</a>
7846
</>
7947
) : (
8048
<>
8149
<p className="mb-6 text-gray-400">
82-
Scan the QR code or visit this page on your mobile device to see your Wrapped.
50+
Visit this page on your mobile device to see your Wrapped.
8351
</p>
8452
<div className="flex gap-4">
8553
<a

0 commit comments

Comments
 (0)