minor: heavily simplify server and app content. unify styling (#4)
All checks were successful
ci/woodpecker/push/push Pipeline was successful
All checks were successful
ci/woodpecker/push/push Pipeline was successful
Co-authored-by: Madison Grubb <madison@elastiflow.com> Reviewed-on: #4
This commit was merged in pull request #4.
This commit is contained in:
@@ -1,18 +1,13 @@
|
||||
/**
|
||||
* Fetch WebRTC failure reason (e.g. wrong host). Pure: same inputs → same output.
|
||||
* @returns {Promise<{ wrongHost: { serverHostname: string, clientHostname: string } | null }>} Failure reason or null.
|
||||
*/
|
||||
/** Pure: fetches WebRTC failure reason (e.g. wrong host). Returns frozen object. */
|
||||
export async function getWebRTCFailureReason() {
|
||||
try {
|
||||
const res = await $fetch('/api/live/debug-request-host', { credentials: 'include' })
|
||||
const clientHostname = typeof window !== 'undefined' ? window.location.hostname : ''
|
||||
const serverHostname = res?.hostname ?? ''
|
||||
if (serverHostname && clientHostname && serverHostname !== clientHostname) {
|
||||
return { wrongHost: { serverHostname, clientHostname } }
|
||||
return Object.freeze({ wrongHost: Object.freeze({ serverHostname, clientHostname }) })
|
||||
}
|
||||
}
|
||||
catch {
|
||||
// ignore
|
||||
}
|
||||
return { wrongHost: null }
|
||||
catch { /* ignore */ }
|
||||
return Object.freeze({ wrongHost: null })
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user