Share: sync

This commit is contained in:
Frank
2025-05-23 14:40:28 -04:00
committed by Dax Raad
parent 8cbd59296e
commit 34a2dcb80a
5 changed files with 36 additions and 28 deletions

View File

@@ -3,7 +3,7 @@ import { createSignal, onCleanup, onMount, Show, For } from "solid-js"
import { useParams } from "@solidjs/router"
type Message = {
filename: string
key: string
content: string
}
@@ -39,7 +39,7 @@ export default function SharePage() {
setConnectionStatus("Connecting...")
// Always use secure WebSocket protocol (wss)
const wsBaseUrl = apiUrl.replace(/^https?:\/\//, 'wss://')
const wsBaseUrl = apiUrl.replace(/^https?:\/\//, "wss://")
const wsUrl = `${wsBaseUrl}/share_poll?share_id=${shareId}`
console.log("Connecting to WebSocket URL:", wsUrl)
@@ -78,7 +78,7 @@ export default function SharePage() {
clearTimeout(reconnectTimer)
reconnectTimer = window.setTimeout(
setupWebSocket,
2000
2000,
) as unknown as number
}
}
@@ -133,7 +133,7 @@ export default function SharePage() {
}}
>
<div>
<strong>Filename:</strong> {msg.filename}
<strong>Key:</strong> {msg.key}
</div>
<div>
<strong>Content:</strong> {msg.content}