mirror of
https://github.com/desktop/desktop
synced 2024-09-12 21:01:16 +00:00
Merge pull request #13747 from desktop/Refactor-getAppArchitecture(remote.app)
-to-main-process
Refactor `getArchitecture(remote.app)` to main process
This commit is contained in:
commit
64acbb750a
|
@ -9,6 +9,7 @@ import { WindowState } from './window-state'
|
|||
import { IMenu } from '../models/app-menu'
|
||||
import { ILaunchStats } from './stats'
|
||||
import { URLActionType } from './parse-app-url'
|
||||
import { Architecture } from './get-architecture'
|
||||
import { EndpointToken } from './endpoint-token'
|
||||
|
||||
/**
|
||||
|
@ -81,6 +82,7 @@ export type RequestChannels = {
|
|||
* Return signatures must be promises
|
||||
*/
|
||||
export type RequestResponseChannels = {
|
||||
'get-app-architecture': () => Promise<Architecture>
|
||||
'move-to-trash': (path: string) => Promise<void>
|
||||
'show-contextual-menu': (
|
||||
items: ReadonlyArray<ISerializableMenuItem>
|
||||
|
|
|
@ -22,8 +22,8 @@ import {
|
|||
} from '../local-storage'
|
||||
import { PushOptions } from '../git'
|
||||
import { getShowSideBySideDiff } from '../../ui/lib/diff-mode'
|
||||
import * as remote from '@electron/remote'
|
||||
import { Architecture, getArchitecture } from '../get-architecture'
|
||||
import { getAppArchitecture } from '../../ui/main-process-proxy'
|
||||
import { Architecture } from '../get-architecture'
|
||||
import { MultiCommitOperationKind } from '../../models/multi-commit-operation'
|
||||
import { isInApplicationFolder } from '../../ui/main-process-proxy'
|
||||
|
||||
|
@ -523,7 +523,7 @@ export class StatsStore implements IStatsStore {
|
|||
version: getVersion(),
|
||||
osVersion: getOS(),
|
||||
platform: process.platform,
|
||||
architecture: getArchitecture(remote.app),
|
||||
architecture: await getAppArchitecture(),
|
||||
theme: getPersistedThemeName(),
|
||||
selectedTerminalEmulator,
|
||||
selectedTextEditor,
|
||||
|
|
|
@ -28,6 +28,7 @@ import { installAuthenticatedAvatarFilter } from './authenticated-avatar-filter'
|
|||
import { installAliveOriginFilter } from './alive-origin-filter'
|
||||
import { installSameOriginFilter } from './same-origin-filter'
|
||||
import * as ipcMain from './ipc-main'
|
||||
import { getArchitecture } from '../lib/get-architecture'
|
||||
import * as remoteMain from '@electron/remote/main'
|
||||
remoteMain.initialize()
|
||||
|
||||
|
@ -519,6 +520,11 @@ app.on('ready', () => {
|
|||
}
|
||||
})
|
||||
|
||||
/**
|
||||
* An event sent by the renderer asking for the app's architecture
|
||||
*/
|
||||
ipcMain.handle('get-app-architecture', async () => getArchitecture(app))
|
||||
|
||||
/**
|
||||
* An event sent by the renderer asking to move the app to the application
|
||||
* folder
|
||||
|
|
|
@ -164,6 +164,11 @@ export const showCertificateTrustDialog = sendProxy(
|
|||
2
|
||||
)
|
||||
|
||||
/**
|
||||
* Tell the main process to obtain the applications architecture
|
||||
*/
|
||||
export const getAppArchitecture = invokeProxy('get-app-architecture', 0)
|
||||
|
||||
/**
|
||||
* Tell the main process that we're going to quit. This means it should allow
|
||||
* the window to close.
|
||||
|
|
Loading…
Reference in a new issue