Track zoom factor changes through IPC

This commit is contained in:
Fedor Indutny 2021-09-02 16:29:16 -07:00 committed by GitHub
parent 3e18a8a337
commit 0793aa6b43
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 66 additions and 27 deletions

View file

@ -107,6 +107,7 @@ export type IPCEventsCallbacksType = {
customColor?: { id: string; value: CustomColorType }
) => void;
getDefaultConversationColor: () => DefaultConversationColorType;
setPassiveZoomFactor: (factor: number) => Promise<void>;
};
type ValuesWithGetters = Omit<
@ -166,10 +167,8 @@ export function createIPCEvents(
getDeviceName: () => window.textsecure.storage.user.getDeviceName(),
getZoomFactor: () => window.storage.get('zoomFactor', 1),
setZoomFactor: (zoomFactor: ZoomFactorType) => {
const numZoomFactor = zoomFactor;
webFrame.setZoomFactor(numZoomFactor);
return window.storage.put('zoomFactor', numZoomFactor);
setZoomFactor: async (zoomFactor: ZoomFactorType) => {
webFrame.setZoomFactor(zoomFactor);
},
getPreferredAudioInputDevice: () =>
@ -508,6 +507,9 @@ export function createIPCEvents(
getMediaPermissions: window.getMediaPermissions,
getMediaCameraPermissions: window.getMediaCameraPermissions,
setPassiveZoomFactor: zoomFactor =>
window.storage.put('zoomFactor', zoomFactor),
...overrideEvents,
};
}