@allow-large-files [flipper][deps] Upgrade Electron (#636)
Summary: allow-large-files Pull Request resolved: https://github.com/facebook/flipper/pull/636 per title Reviewed By: jknoxville Differential Revision: D18374332 fbshipit-source-id: f7300f527b65b65caebac51c5bcf8f019dc34228
This commit is contained in:
committed by
Facebook Github Bot
parent
0914deda2d
commit
a578b4d559
@@ -107,7 +107,7 @@ export function setupMenuBar(
|
||||
const menu = applicationMenu.items.find(
|
||||
menuItem => menuItem.label === topLevelMenu,
|
||||
);
|
||||
if (menu) {
|
||||
if (menu && menu.submenu) {
|
||||
const menuItem = menu.submenu.items.find(
|
||||
menuItem => menuItem.label === label,
|
||||
);
|
||||
@@ -187,14 +187,17 @@ function getTemplate(
|
||||
label: 'File...',
|
||||
accelerator: 'CommandOrControl+E',
|
||||
click: function() {
|
||||
electron.remote.dialog.showSaveDialog(
|
||||
// @ts-ignore This appears to work but isn't allowed by the types
|
||||
null,
|
||||
{
|
||||
title: 'FlipperExport',
|
||||
defaultPath: path.join(os.homedir(), 'FlipperExport.flipper'),
|
||||
},
|
||||
async (file: string) => {
|
||||
electron.remote.dialog
|
||||
.showSaveDialog(
|
||||
// @ts-ignore This appears to work but isn't allowed by the types
|
||||
null,
|
||||
{
|
||||
title: 'FlipperExport',
|
||||
defaultPath: path.join(os.homedir(), 'FlipperExport.flipper'),
|
||||
},
|
||||
)
|
||||
.then(async (result: electron.SaveDialogReturnValue) => {
|
||||
const file = result.filePath;
|
||||
if (!file) {
|
||||
return;
|
||||
}
|
||||
@@ -205,8 +208,7 @@ function getTemplate(
|
||||
closeOnFinish: false,
|
||||
}),
|
||||
);
|
||||
},
|
||||
);
|
||||
});
|
||||
},
|
||||
},
|
||||
];
|
||||
@@ -297,7 +299,7 @@ function getTemplate(
|
||||
{
|
||||
label: 'Select All',
|
||||
accelerator: 'CmdOrCtrl+A',
|
||||
role: 'selectall',
|
||||
role: 'selectAll',
|
||||
},
|
||||
],
|
||||
},
|
||||
@@ -411,7 +413,7 @@ function getTemplate(
|
||||
];
|
||||
|
||||
if (process.platform === 'darwin') {
|
||||
const name = app.getName();
|
||||
const name = app.name;
|
||||
template.unshift({
|
||||
label: name,
|
||||
submenu: [
|
||||
@@ -438,7 +440,7 @@ function getTemplate(
|
||||
{
|
||||
label: 'Hide Others',
|
||||
accelerator: 'Command+Shift+H',
|
||||
role: 'hideothers',
|
||||
role: 'hideOthers',
|
||||
},
|
||||
{
|
||||
label: 'Show All',
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
import electron from 'electron';
|
||||
import {FlexColumn, styled, Text, FlexRow, Input, colors, Glyph} from 'flipper';
|
||||
import React, {useState} from 'react';
|
||||
import {promises as fs} from 'fs';
|
||||
@@ -87,16 +88,18 @@ export function FilePathConfigField(props: {
|
||||
/>
|
||||
<FlexColumn
|
||||
onClick={() =>
|
||||
remote.dialog.showOpenDialog(
|
||||
{
|
||||
remote.dialog
|
||||
.showOpenDialog({
|
||||
properties: ['openDirectory', 'showHiddenFiles'],
|
||||
defaultPath: path.resolve('/'),
|
||||
},
|
||||
(paths: Array<string> | undefined) => {
|
||||
paths && setValue(paths[0]);
|
||||
paths && props.onChange(paths[0]);
|
||||
},
|
||||
)
|
||||
})
|
||||
.then((result: electron.SaveDialogReturnValue) => {
|
||||
if (result.filePath) {
|
||||
const path: string = result.filePath.toString();
|
||||
setValue(path);
|
||||
props.onChange(path);
|
||||
}
|
||||
})
|
||||
}>
|
||||
<CenteredGlyph name="dots-3-circle" variant="outline" />
|
||||
</FlexColumn>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* @format
|
||||
*/
|
||||
|
||||
import {remote, ipcRenderer} from 'electron';
|
||||
import {remote, ipcRenderer, IpcRendererEvent} from 'electron';
|
||||
import {toggleAction} from '../reducers/application';
|
||||
import {setStaticView} from '../reducers/connections';
|
||||
import {Store} from '../reducers/index.js';
|
||||
@@ -57,7 +57,7 @@ export default (store: Store, logger: Logger) => {
|
||||
|
||||
ipcRenderer.on(
|
||||
'flipper-protocol-handler',
|
||||
(_event: string, query: string) => {
|
||||
(_event: IpcRendererEvent, query: string) => {
|
||||
const uri = new URL(query);
|
||||
if (query.startsWith('flipper://import')) {
|
||||
const {search} = new URL(query);
|
||||
@@ -102,11 +102,14 @@ export default (store: Store, logger: Logger) => {
|
||||
},
|
||||
);
|
||||
|
||||
ipcRenderer.on('open-flipper-file', (_event: string, url: string) => {
|
||||
tryCatchReportPlatformFailures(() => {
|
||||
return importFileToStore(url, store);
|
||||
}, `${IMPORT_FLIPPER_TRACE_EVENT}:Deeplink`);
|
||||
});
|
||||
ipcRenderer.on(
|
||||
'open-flipper-file',
|
||||
(_event: IpcRendererEvent, url: string) => {
|
||||
tryCatchReportPlatformFailures(() => {
|
||||
return importFileToStore(url, store);
|
||||
}, `${IMPORT_FLIPPER_TRACE_EVENT}:Deeplink`);
|
||||
},
|
||||
);
|
||||
|
||||
if (process.env.FLIPPER_PORTS) {
|
||||
const portOverrides = parseFlipperPorts(process.env.FLIPPER_PORTS);
|
||||
|
||||
@@ -12,7 +12,7 @@ import {Logger} from '../fb-interfaces/Logger';
|
||||
import {PluginNotification} from '../reducers/notifications';
|
||||
import {FlipperPlugin, FlipperDevicePlugin} from '../plugin';
|
||||
import isHeadless from '../utils/isHeadless';
|
||||
import {ipcRenderer} from 'electron';
|
||||
import {ipcRenderer, IpcRendererEvent} from 'electron';
|
||||
import {selectPlugin} from '../reducers/connections';
|
||||
import {
|
||||
setActiveNotifications,
|
||||
@@ -37,6 +37,7 @@ export default (store: Store, logger: Logger) => {
|
||||
ipcRenderer.on(
|
||||
'notificationEvent',
|
||||
(
|
||||
_event: IpcRendererEvent,
|
||||
_e: Error,
|
||||
eventName: NotificationEvents,
|
||||
pluginNotification: PluginNotification,
|
||||
|
||||
@@ -669,8 +669,9 @@ export function showOpenDialog(store: Store) {
|
||||
properties: ['openFile'],
|
||||
filters: [{extensions: ['flipper', 'json', 'txt'], name: 'Flipper files'}],
|
||||
};
|
||||
remote.dialog.showOpenDialog(options, (filePaths?: Array<string>) => {
|
||||
if (filePaths !== undefined && filePaths.length > 0) {
|
||||
remote.dialog.showOpenDialog(options).then(result => {
|
||||
const filePaths = result.filePaths;
|
||||
if (filePaths.length > 0) {
|
||||
tryCatchReportPlatformFailures(() => {
|
||||
importFileToStore(filePaths[0], store);
|
||||
}, `${IMPORT_FLIPPER_TRACE_EVENT}:UI`);
|
||||
|
||||
Reference in New Issue
Block a user