Skip to content

Commit 7b4a274

Browse files
authored
fix: prevent Safari iOS 16 crash in charter flow (#661)
1 parent 5184ded commit 7b4a274

File tree

4 files changed

+29
-11
lines changed

4 files changed

+29
-11
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Browsers that we support
2+
# iOS 16+ Safari support
3+
4+
>= 0.5%
5+
last 2 versions
6+
not dead
7+
iOS >= 15
8+
Safari >= 15
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/// <reference types="next" />
22
/// <reference types="next/image-types/global" />
3+
/// <reference path="./.next/types/routes.d.ts" />
34

45
// NOTE: This file should not be edited
56
// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.

platforms/group-charter-manager/next.config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ import path from "path";
44
const nextConfig: NextConfig = {
55
output: 'standalone',
66
outputFileTracingRoot: path.join(__dirname),
7+
8+
// 🔴 Critical for Safari 16 compatibility
9+
transpilePackages: [
10+
'marked',
11+
'@milkdown/preset-gfm',
12+
],
713
};
814

915
export default nextConfig;

platforms/group-charter-manager/src/components/MaintenanceBanner.tsx

Lines changed: 14 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
'use client';
1+
"use client";
22

3-
import { useEffect, useState } from 'react';
4-
import axios from 'axios';
3+
import { useEffect, useState } from "react";
4+
import axios from "axios";
55

66
interface Motd {
7-
status: 'up' | 'maintenance';
7+
status: "up" | "maintenance";
88
message: string;
99
}
1010

11-
const DISMISSED_KEY = 'maintenance-banner-dismissed';
11+
const DISMISSED_KEY = "maintenance-banner-dismissed";
1212

1313
export function MaintenanceBanner() {
1414
const [motd, setMotd] = useState<Motd | null>(null);
@@ -17,17 +17,21 @@ export function MaintenanceBanner() {
1717
useEffect(() => {
1818
const fetchMotd = async () => {
1919
try {
20-
const registryUrl = process.env.NEXT_PUBLIC_REGISTRY_URL || 'http://localhost:4321';
20+
const registryUrl = process.env.NEXT_PUBLIC_REGISTRY_URL;
21+
if (!registryUrl) {
22+
// Skip fetching in local dev if env var not set
23+
return;
24+
}
2125
const response = await axios.get<Motd>(`${registryUrl}/motd`);
2226
setMotd(response.data);
23-
27+
2428
// Check if this message has been dismissed
25-
if (response.data.status === 'maintenance') {
29+
if (response.data.status === "maintenance") {
2630
const dismissed = localStorage.getItem(DISMISSED_KEY);
2731
setIsDismissed(dismissed === response.data.message);
2832
}
2933
} catch (error) {
30-
console.error('Failed to fetch motd:', error);
34+
console.error("Failed to fetch motd:", error);
3135
}
3236
};
3337

@@ -41,7 +45,7 @@ export function MaintenanceBanner() {
4145
}
4246
};
4347

44-
if (motd?.status !== 'maintenance' || isDismissed) {
48+
if (motd?.status !== "maintenance" || isDismissed) {
4549
return null;
4650
}
4751

@@ -71,4 +75,3 @@ export function MaintenanceBanner() {
7175
</div>
7276
);
7377
}
74-

0 commit comments

Comments
 (0)