Fix a few stray references to BrowserWindow

This commit is contained in:
Ben Gotow 2022-08-08 20:30:24 -05:00
parent ad30bcf641
commit c6f5a164ec
2 changed files with 14 additions and 9 deletions

View file

@ -107,7 +107,7 @@ class PreferencesAccountDetails extends Component<
this.props.onAccountUpdated(this.props.account, this.state.account);
};
_setState = (updates, callback = () => { }) => {
_setState = (updates, callback = () => {}) => {
const account = Object.assign(this.state.account.clone(), updates);
this.setState({ account }, callback);
};
@ -169,20 +169,20 @@ class PreferencesAccountDetails extends Component<
ipcRenderer.send('command', 'application:show-contacts', {});
};
_onSetColor = (colorChanged) => {
_onSetColor = colorChanged => {
// TODO: Ensure that the account color is updated in all places where it is displayed:
// - internal_packages/composer/lib/account-contict-field.tsx
// - internal_packages/contacts/lib/ContactsList.tsx
// - internal_packages/preferecnes/lib/preferences-account-list.tsx
// - internal/packages/thread-list/lib/thread-lib-participants.tsx
// - src/components/outline-view.tsx
this._setState(colorChanged)
}
this._setState(colorChanged);
};
_onResetColor = () => {
this.state.account.color = '';
this._saveChanges();
}
};
_onContactSupport = () => {
shell.openExternal('https://support.getmailspring.com/hc/en-us/requests/new');
@ -216,7 +216,7 @@ class PreferencesAccountDetails extends Component<
AppEnv.showErrorDialog({ title: 'Error', message: `Could not retrieve sync logs. ${err}` });
return;
}
const { BrowserWindow } = require('electron');
const { BrowserWindow } = require('@electron/remote');
const win = new BrowserWindow({
width: 800,
height: 600,

View file

@ -105,7 +105,7 @@ export class MailsyncProcess extends EventEmitter {
_showStatusWindow(mode) {
if (this._win) return;
const { BrowserWindow } = require('electron');
const { BrowserWindow } = require('@electron/remote');
this._win = new BrowserWindow({
width: 350,
height: 108,
@ -117,7 +117,12 @@ export class MailsyncProcess extends EventEmitter {
maximizable: false,
closable: false,
fullscreenable: false,
webPreferences: { nodeIntegration: false, javascript: false, contextIsolation: false, enableRemoteModule: true },
webPreferences: {
nodeIntegration: false,
javascript: false,
contextIsolation: false,
enableRemoteModule: true,
},
});
this._win.setContentSize(350, 90);
this._win.once('ready-to-show', () => {
@ -330,7 +335,7 @@ export class MailsyncProcess extends EventEmitter {
console.log(`Sending to mailsync ${this.account ? this.account.id : '?'}`, json);
const msg = `${JSON.stringify(json)}\n`;
try {
this._proc.stdin.write(msg, 'UTF8');
this._proc.stdin.write(msg, 'utf-8');
} catch (error) {
if (error && error.message.includes('socket has been ended')) {
// The process probably already exited and we missed it somehow,