Add browser support with Socket.io transport, authentication, performance-optimized IPC, and CI/CD (#925)

This commit is contained in:
Copilot
2025-12-20 02:35:34 +01:00
committed by GitHub
parent 8285627c5f
commit 91df6de4d4
42 changed files with 2805 additions and 290 deletions

View File

@@ -1,6 +1,5 @@
import compareVersions from 'compare-versions'
import electron from 'electron'
import os from 'os'
import React from 'react'
import axios from 'axios'
import Close from '@material-ui/icons/Close'
@@ -182,9 +181,10 @@ class UpdateNotifier extends React.PureComponent<Props, State> {
private assetForCurrentPlatform(asset: GithubAsset) {
let regex: RegExp
if (os.platform() === 'darwin') {
const platform = this.getPlatform()
if (platform === 'darwin') {
regex = /\.dmg$/
} else if (os.platform() === 'win32') {
} else if (platform === 'win32') {
regex = /\.exe$/
} else {
regex = /\.AppImage$/
@@ -193,6 +193,14 @@ class UpdateNotifier extends React.PureComponent<Props, State> {
return regex.test(asset.name)
}
private getPlatform(): string {
if (typeof window === 'undefined') return 'linux'
const userAgent = window.navigator.userAgent.toLowerCase()
if (userAgent.includes('mac')) return 'darwin'
if (userAgent.includes('win')) return 'win32'
return 'linux'
}
private renderDownloads() {
const latestUpdate = this.state.newerVersions[0]
if (!latestUpdate || !latestUpdate.assets) {