Skip to content

Commit

Permalink
Refactor URL handling and temporarily disable Gleap initialization (#…
Browse files Browse the repository at this point in the history
…1482)

- Updated the canonical URL in the structured data generation to use the
dynamic WEB_URL from envConfig for better maintainability.
- Temporarily disabled the Gleap initialization in the GleapInit
component to prevent errors when the API key is not set.

These changes enhance the application's configuration management and
prevent potential issues with Gleap integration.
  • Loading branch information
smian1 authored Dec 5, 2024
2 parents c0f4c58 + dbcb8bc commit 0246068
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion frontend/src/app/apps/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export async function generateMetadata(

// Add a separate function to handle JSON-LD
export function generateStructuredData(plugin: Plugin, categoryName: string) {
const canonicalUrl = `https://omi.me/apps/${plugin.id}`;
const canonicalUrl = `${envConfig.WEB_URL}/apps/${plugin.id}`;
const appStoreUrl = 'https://apps.apple.com/us/app/friend-ai-wearable/id6502156163';
const playStoreUrl = 'https://play.google.com/store/apps/details?id=com.friend.ios';
const productUrl = 'https://www.omi.me/products/friend-dev-kit-2';
Expand Down
6 changes: 5 additions & 1 deletion frontend/src/components/shared/gleap.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ import envConfig from '@/src/constants/envConfig';

export const GleapInit: FC<{ children?: ReactNode }> = ({ children }) => {
useEffect(() => {
Gleap.initialize(envConfig.GLEAP_API_KEY ?? '');
// Temporarily disabled Gleap initialization
// const isGleapEnabled = envConfig.GLEAP_API_KEY && process.env.NEXT_PUBLIC_ENABLE_GLEAP !== 'false';
// if (isGleapEnabled) {
// Gleap.initialize(envConfig.GLEAP_API_KEY ?? '');
// }
}, []);
return <>{children}</>;
};
2 changes: 1 addition & 1 deletion frontend/src/components/shared/google-analytics.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,4 @@ export function GoogleAnalytics() {
</Script>
</>
);
}
}

0 comments on commit 0246068

Please sign in to comment.