check to whether the zoomFactor is shown in preload.js

pull/905/head
Brian Jian Zhao 5 years ago
parent 96e9a68abd
commit b2322bae02

@ -325,13 +325,13 @@
}, },
getZoomFactor: () => storage.get('zoom-factor-setting', 48), // getZoomFactor: () => storage.get('zoom-factor-setting', 48),
setZoomFactor: value => { // setZoomFactor: value => {
// Make sure the ttl is between a given range and is valid // // Make sure the ttl is between a given range and is valid
const intValue = parseInt(value, 10); // const intValue = parseInt(value, 10);
const factor = Number.isNaN(intValue) ? 24 : intValue; // const factor = Number.isNaN(intValue) ? 24 : intValue;
storage.put('zoom-factor-setting', factor); // storage.put('zoom-factor-setting', factor);
}, // },
getReadReceiptSetting: () => storage.get('read-receipt-setting'), getReadReceiptSetting: () => storage.get('read-receipt-setting'),
setReadReceiptSetting: value => setReadReceiptSetting: value =>

@ -81,6 +81,11 @@ window.wrapDeferred = deferredToPromise;
const ipc = electron.ipcRenderer; const ipc = electron.ipcRenderer;
const localeMessages = ipc.sendSync('locale-data'); const localeMessages = ipc.sendSync('locale-data');
Window.updateScaling = (number) => {
ipc.s
}
window.setBadgeCount = count => ipc.send('set-badge-count', count); window.setBadgeCount = count => ipc.send('set-badge-count', count);
// Set the password for the database // Set the password for the database
@ -160,6 +165,9 @@ ipc.on('on-unblock-number', (event, number) => {
window.closeAbout = () => ipc.send('close-about'); window.closeAbout = () => ipc.send('close-about');
window.readyForUpdates = () => ipc.send('ready-for-updates'); window.readyForUpdates = () => ipc.send('ready-for-updates');
window.updateTrayIcon = unreadCount => window.updateTrayIcon = unreadCount =>
ipc.send('update-tray-icon', unreadCount); ipc.send('update-tray-icon', unreadCount);
@ -177,6 +185,9 @@ ipc.on('set-up-as-standalone', () => {
// Settings-related events // Settings-related events
console.log(window.getSettingValue('zoom-factor-setting'), 'from preloadJS and get the setting value');
window.showSettings = () => ipc.send('show-settings'); window.showSettings = () => ipc.send('show-settings');
window.showPermissionsPopup = () => ipc.send('show-permissions-popup'); window.showPermissionsPopup = () => ipc.send('show-permissions-popup');
@ -212,6 +223,8 @@ window.getSettingValue = (settingID, comparisonValue = null) => {
return comparisonValue ? !!settingVal === comparisonValue : settingVal; return comparisonValue ? !!settingVal === comparisonValue : settingVal;
}; };
window.setSettingValue = (settingID, value) => { window.setSettingValue = (settingID, value) => {
window.storage.put(settingID, value); window.storage.put(settingID, value);
}; };
@ -229,9 +242,9 @@ installGetter('message-ttl', 'getMessageTTL');
installSetter('message-ttl', 'setMessageTTL'); installSetter('message-ttl', 'setMessageTTL');
// Get the zoom Factor setting // Get the zoom Factor setting
window.getZoomFactor = () => window.storage.get('zoom-factor-setting',50) // window.getZoomFactor = () => window.storage.get('zoom-factor-setting',50)
installGetter('zoom-factor-setting', 'getZoomFactor'); // installGetter('zoom-factor-setting', 'getZoomFactor');
installSetter('zoom-factor-setting', 'setZoomFactor'); // installSetter('zoom-factor-setting', 'setZoomFactor');
installGetter('read-receipt-setting', 'getReadReceiptSetting'); installGetter('read-receipt-setting', 'getReadReceiptSetting');
installSetter('read-receipt-setting', 'setReadReceiptSetting'); installSetter('read-receipt-setting', 'setReadReceiptSetting');

Loading…
Cancel
Save