Eliminate remaining Electron 8 deprecations

* Change systemPreferences.isDarkMode() to nativeTheme.shouldUseDarkColors

* Remove vibrancy parameter to BrowserWindow

* Update curve25519-n; removes context-aware deprecation warning

* Set app.allowRendererProcessReuse = true to remove warning

* Move from deprecated setters to direct property set

* Serialized sender certificates: Store less, store plain object

* isMenuBarAutoHide -> autoHideMenuBar

* UUID: Fix sealed sender indicator on message details screen

* Data._cleanData: Remove function keys, handle null in array

Also:
- run _cleanData when saving attachment download jobs
- remove job from jobs table when the send itself throws error

* _cleanData: Don't dig into strings, booleans, or numbers

* getPropsForMessageDetail: Make it clear what we're reducing

Co-authored-by: Ken Powers <ken@signal.org>
This commit is contained in:
Scott Nonnenberg 2020-03-19 13:57:50 -04:00
parent 841461934d
commit 8d6cba1b43
11 changed files with 108 additions and 107 deletions

15
main.js
View file

@ -41,6 +41,10 @@ console.log('Set Windows Application User Model ID (AUMID)', {
});
app.setAppUserModelId(appUserModelId);
// We don't navigate, but this is the way of the future
// https://github.com/electron/electron/issues/18397
app.allowRendererProcessReuse = true;
// Keep a global reference of the window object, if you don't, the window will
// be closed automatically when the JavaScript object is garbage collected.
let mainWindow;
@ -250,7 +254,6 @@ function createWindow() {
config.environment === 'test' || config.environment === 'test-lib'
? '#ffffff' // Tests should always be rendered on a white background
: '#3a76f0',
vibrancy: 'appearance-based',
webPreferences: {
nodeIntegration: false,
nodeIntegrationInWorker: false,
@ -311,7 +314,7 @@ function createWindow() {
// so if we need to recreate the window, we have the most recent settings
windowConfig = {
maximized: mainWindow.isMaximized(),
autoHideMenuBar: mainWindow.isMenuBarAutoHide(),
autoHideMenuBar: mainWindow.autoHideMenuBar,
fullscreen: mainWindow.isFullScreen(),
width: size[0],
height: size[1],
@ -496,7 +499,6 @@ function showAbout() {
autoHideMenuBar: true,
backgroundColor: '#3a76f0',
show: false,
vibrancy: 'appearance-based',
webPreferences: {
nodeIntegration: false,
nodeIntegrationInWorker: false,
@ -545,7 +547,6 @@ async function showSettingsWindow() {
backgroundColor: '#3a76f0',
show: false,
modal: true,
vibrancy: 'appearance-based',
webPreferences: {
nodeIntegration: false,
nodeIntegrationInWorker: false,
@ -665,7 +666,6 @@ async function showDebugLogWindow() {
backgroundColor: '#3a76f0',
show: false,
modal: true,
vibrancy: 'appearance-based',
webPreferences: {
nodeIntegration: false,
nodeIntegrationInWorker: false,
@ -714,7 +714,6 @@ async function showPermissionsPopupWindow() {
backgroundColor: '#3a76f0',
show: false,
modal: true,
vibrancy: 'appearance-based',
webPreferences: {
nodeIntegration: false,
nodeIntegrationInWorker: false,
@ -990,7 +989,7 @@ app.on('will-finish-launching', () => {
});
ipc.on('set-badge-count', (event, count) => {
app.setBadgeCount(count);
app.badgeCount = count;
});
ipc.on('remove-setup-menu-items', () => {
@ -1023,7 +1022,7 @@ ipc.on('restart', () => {
ipc.on('set-auto-hide-menu-bar', (event, autoHide) => {
if (mainWindow) {
mainWindow.setAutoHideMenuBar(autoHide);
mainWindow.autoHideMenuBar = autoHide;
}
});