mirror of
https://github.com/stablyai/orca.git
synced 2026-11-13 17:37:40 +00:00
* chore(endpoints): call orca.dev for feedback, plugin lists and update notes The site moved to orca.dev. Feedback, connection diagnostics, plugin install stats, the plugin kill list, update nudges and the changelog feed now use orca.dev, as do the diagnostics token URL baked into builds and the release download mirror (downloads.orca.dev). The old hosts serve the same paths, so released builds keep working. Skill share links on share.orca.dev are accepted, and the mobile scanner recognizes the orca.dev Android download code. The old hosts stay accepted. * chore(ci): leave the release JavaScript benchmark workflow unchanged Editing it triggers the benchmark, whose parity check currently fails on arm64 because max-quality brotli output for the mobile page differs by architecture. The benchmark only needs some diagnostics URL, and the old host still serves it.
39 lines
1.3 KiB
TypeScript
39 lines
1.3 KiB
TypeScript
import type { Translate } from '../i18n/mobile-i18n'
|
|
|
|
function isOrcaInstallUrl(data: string): boolean {
|
|
try {
|
|
const url = new URL(data.trim())
|
|
const path = url.pathname.replace(/\/$/, '')
|
|
switch (url.origin) {
|
|
case 'https://apps.apple.com':
|
|
return /^\/(?:[a-z]{2}\/)?app\/(?:[^/]+\/)?id6766130217$/.test(path)
|
|
// onorca.dev: desktops released before the move to orca.dev show the old host.
|
|
case 'https://orca.dev':
|
|
case 'https://www.orca.dev':
|
|
case 'https://www.onorca.dev':
|
|
case 'https://onorca.dev':
|
|
return path === '/download/android'
|
|
// Older desktops offered TestFlight and versioned APK downloads.
|
|
case 'https://testflight.apple.com':
|
|
return path === '/join/YjeGMQBA'
|
|
case 'https://github.com':
|
|
return /^\/stablyai\/orca\/releases\/download\/mobile-android-v[^/]+\/app-release\.apk$/.test(
|
|
path
|
|
)
|
|
default:
|
|
return false
|
|
}
|
|
} catch {
|
|
return false
|
|
}
|
|
}
|
|
|
|
export function getPairingScanErrorMessage(data: string, t: Translate): string {
|
|
return isOrcaInstallUrl(data)
|
|
? t(
|
|
'app.pairScan.downloadQrCode',
|
|
"That's the download code. Scan the pairing code in step 2 on your desktop."
|
|
)
|
|
: t('app.pairScan.invalidQrCode', 'Not a valid Orca QR code')
|
|
}
|