Back out "Back out Electron 7.1.1/7.1.2 upgrades"

Summary:
Original commit changeset: 05d13aca7145

Attempt to upgrade `electron` as it instacrashed; `electron-builder` version 22.1.0 didn't sign package correctly and caused the instacrash,

Reduced the version to 21.2.0 (latest).

Reviewed By: passy, nikoant

Differential Revision: D18954671

fbshipit-source-id: bc2dbd4fec9afb51d9a535974651b13d195407b4
This commit is contained in:
Chaiwat Ekkaewnumchai
2020-01-06 09:42:46 -08:00
committed by Facebook Github Bot
parent 2fac06e018
commit bacb1958fc
11 changed files with 351 additions and 564 deletions

View File

@@ -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>