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

View file

@ -13,7 +13,7 @@ try {
const { remote } = electron;
const { app } = remote;
const { systemPreferences } = remote.require('electron');
const { nativeTheme } = remote.require('electron');
window.PROTO_ROOT = 'protos';
const config = require('url').parse(window.location.toString(), true).query;
@ -38,22 +38,16 @@ try {
window.isBehindProxy = () => Boolean(config.proxyUrl);
function setSystemTheme() {
window.systemTheme = systemPreferences.isDarkMode() ? 'dark' : 'light';
window.systemTheme = nativeTheme.shouldUseDarkColors ? 'dark' : 'light';
}
setSystemTheme();
window.subscribeToSystemThemeChange = fn => {
if (!systemPreferences.subscribeNotification) {
return;
}
systemPreferences.subscribeNotification(
'AppleInterfaceThemeChangedNotification',
() => {
setSystemTheme();
fn();
}
);
nativeTheme.on('updated', () => {
setSystemTheme();
fn();
});
};
window.isBeforeVersion = (toCheck, baseVersion) => {