Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 67 additions & 38 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@
"tar-fs": "^2.1.1",
"unbzip2-stream": "^1.4.3",
"web-ext": "^6.7.0",
"which": "^2.0.2"
"which": "^2.0.2",
"ws": "^8.8.0"
},
"devDependencies": {
"@babel/core": "7.17.2",
Expand Down
6 changes: 3 additions & 3 deletions shared/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,17 @@ export default class Logger {
}

info = (...log: string[]) => {
// TODO: Add back SYSTEM_INFO or find a better way to log it only once
logger.info(`[${this.module}]`, ...log)
}

error = (...err: any[]) => {
// TODO: Add back SYSTEM_INFO or find a better way to log it only once
logger.error(`[${this.module}]`, ...err)
}

sendToChannel = ({ channel, log }: { channel: string; log: string }) => {
this.window?.webContents.send(channel, log)
try {
this.window?.webContents.send(channel, log)
} catch (error) {}
}

sendMetric = (payload: Record<string, string | number | boolean>) => {
Expand Down
31 changes: 31 additions & 0 deletions shared/react-components/ExternalLink.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { ReactEventHandler } from 'react'
// MUI
import { TypographyVariant } from '@mui/material'
import Typography from '@mui/material/Typography'

const ExternalLink = ({
children,
variant = 'body1',
onClick,
}: {
children: string
variant?: TypographyVariant
onClick: ReactEventHandler
}) => {
return (
<Typography
variant={variant}
color="primary"
sx={{
textDecoration: 'underline',
cursor: 'pointer',
display: 'inline',
}}
onClick={onClick}
>
{children}
</Typography>
)
}

export default ExternalLink
5 changes: 5 additions & 0 deletions src/@types/generic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,8 @@ export type GithubRelease = {
browser_download_url: string // eslint-disable-line camelcase
}>
}

export interface StartTimeoutState {
isTimedOut: boolean
isSet: boolean
}
3 changes: 1 addition & 2 deletions src/@types/ipc_channels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export enum GenericChannelsEnum {
check_for_updates = 'generic:check_for_updates',
get_identifier = 'generic:get_identifier',
minimize_window = 'generic:minimize_window',
open_external_link = 'generic:open_external_link',
}

export enum DashboardChannelsEnum {
Expand All @@ -30,8 +31,6 @@ export enum DashboardChannelsEnum {
get_version = 'dashboard:get_version',
check_for_updates = 'dashboard:check_for_updates',
log_out = 'dashboard:log_out',
open_download_link = 'dashboard:open_download_link',
open_feedback_link = 'dashboard:open_feedback_link',
}

export enum FirefoxChannelsEnum {
Expand Down
14 changes: 5 additions & 9 deletions src/dashboard/bridge.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
import { contextBridge, ipcRenderer } from 'electron'
// Types
import {
BountyChannelsEnum,
DashboardChannelsEnum,
UninstallerChannelsEnum,
} from './../@types/ipc_channels'
import { contextBridge, ipcRenderer } from 'electron'
// Types
import {
FirefoxChannelsEnum,
GenericChannelsEnum,
NodeChannelsEnum,
} from '../@types/ipc_channels'
} from './../@types/ipc_channels'

declare global {
// eslint-disable-next-line
Expand All @@ -28,10 +26,6 @@ export const api = {
getDashboardVersion: () =>
ipcRenderer.send(DashboardChannelsEnum.get_version),
logOut: () => ipcRenderer.send(DashboardChannelsEnum.log_out),
openFeedbackLink: () =>
ipcRenderer.send(DashboardChannelsEnum.open_feedback_link),
openDashboardDownloadLink: () =>
ipcRenderer.send(DashboardChannelsEnum.open_download_link),
// Node
getIdentityInfo: () => ipcRenderer.send(NodeChannelsEnum.get_identity),
pingNode: () => ipcRenderer.send(NodeChannelsEnum.running_status),
Expand All @@ -43,6 +37,8 @@ export const api = {
getFirefoxVersion: () => ipcRenderer.send(FirefoxChannelsEnum.get_version),
launchBrowser: () => ipcRenderer.send(FirefoxChannelsEnum.launch),
// Generic
openExternalLink: (link: string) =>
ipcRenderer.send(GenericChannelsEnum.open_external_link, link),
getIndentifier: () => ipcRenderer.send(GenericChannelsEnum.get_identifier),
checkForUpdates: () =>
ipcRenderer.send(GenericChannelsEnum.check_for_updates),
Expand Down
Loading