bug fixes, layout fixes
This commit is contained in:
@@ -37,7 +37,7 @@ export const Route = createRootRouteWithContext<{
|
||||
{
|
||||
name: "viewport",
|
||||
content:
|
||||
"width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, interactive-widget=overlays-content",
|
||||
"width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, interactive-widget=resizes-content",
|
||||
},
|
||||
],
|
||||
links: [
|
||||
@@ -122,8 +122,7 @@ function RootDocument({ children }: { children: React.ReactNode }) {
|
||||
{...mantineHtmlProps}
|
||||
style={{
|
||||
overflowX: "hidden",
|
||||
overflowY: "hidden",
|
||||
position: "fixed",
|
||||
height: "100%",
|
||||
width: "100%",
|
||||
}}
|
||||
>
|
||||
@@ -135,9 +134,10 @@ function RootDocument({ children }: { children: React.ReactNode }) {
|
||||
<body
|
||||
style={{
|
||||
overflowX: "hidden",
|
||||
overflowY: "hidden",
|
||||
position: "fixed",
|
||||
height: "100%",
|
||||
width: "100%",
|
||||
margin: 0,
|
||||
padding: 0,
|
||||
}}
|
||||
>
|
||||
<div className="app">{children}</div>
|
||||
|
||||
@@ -17,6 +17,10 @@ export const Route = createFileRoute("/api/events/$")({
|
||||
logger.info("ServerEvents | Event received", event);
|
||||
const message = `data: ${JSON.stringify(event)}\n\n`;
|
||||
try {
|
||||
if (!controller.desiredSize || controller.desiredSize <= 0) {
|
||||
logger.warn("ServerEvents | Stream closed, skipping event");
|
||||
return;
|
||||
}
|
||||
controller.enqueue(new TextEncoder().encode(message));
|
||||
} catch (error) {
|
||||
logger.error("ServerEvents | Error sending SSE message", error);
|
||||
@@ -29,9 +33,14 @@ export const Route = createFileRoute("/api/events/$")({
|
||||
|
||||
const pingInterval = setInterval(() => {
|
||||
try {
|
||||
if (!controller.desiredSize || controller.desiredSize <= 0) {
|
||||
clearInterval(pingInterval);
|
||||
return;
|
||||
}
|
||||
const pingMessage = `data: ${JSON.stringify({ type: "ping" })}\n\n`;
|
||||
controller.enqueue(new TextEncoder().encode(pingMessage));
|
||||
} catch (e) {
|
||||
logger.error("ServerEvents | Ping interval error", e);
|
||||
clearInterval(pingInterval);
|
||||
}
|
||||
}, 30000);
|
||||
@@ -49,10 +58,11 @@ export const Route = createFileRoute("/api/events/$")({
|
||||
return new Response(stream, {
|
||||
headers: {
|
||||
"Content-Type": "text/event-stream",
|
||||
"Cache-Control": "no-cache",
|
||||
Connection: "keep-alive",
|
||||
"Cache-Control": "no-cache, no-store, must-revalidate",
|
||||
"Connection": "keep-alive",
|
||||
"Access-Control-Allow-Origin": "*",
|
||||
"Access-Control-Allow-Headers": "Cache-Control",
|
||||
"X-Accel-Buffering": "no",
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user