Sticker Creator Window

This commit is contained in:
Fedor Indutny 2023-04-20 08:59:17 -07:00 committed by GitHub
parent 498b116794
commit d380817a44
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
213 changed files with 34677 additions and 40 deletions

View file

@ -112,7 +112,7 @@ export class SettingsChannel extends EventEmitter {
this.installSetting('phoneNumberDiscoverabilitySetting');
this.installSetting('phoneNumberSharingSetting');
installPermissionsHandler({ session, userConfig });
installPermissionsHandler({ session: session.defaultSession, userConfig });
// These ones are different because its single source of truth is userConfig,
// not IndexedDB
@ -126,13 +126,19 @@ export class SettingsChannel extends EventEmitter {
userConfig.set('mediaPermissions', value);
// We reinstall permissions handler to ensure that a revoked permission takes effect
installPermissionsHandler({ session, userConfig });
installPermissionsHandler({
session: session.defaultSession,
userConfig,
});
});
ipc.handle('settings:set:mediaCameraPermissions', (_event, value) => {
userConfig.set('mediaCameraPermissions', value);
// We reinstall permissions handler to ensure that a revoked permission takes effect
installPermissionsHandler({ session, userConfig });
installPermissionsHandler({
session: session.defaultSession,
userConfig,
});
});
ipc.on('settings:response', (_event, seq, error, value) => {

View file

@ -48,6 +48,8 @@ const FILES_TO_IGNORE = new Set(
'components/webaudiorecorder/lib/WebAudioRecorderMp3.js',
'js/Mp3LameEncoder.min.js',
'js/WebAudioRecorderMp3.js',
'sticker-creator/src/util/protos.d.ts',
'sticker-creator/src/util/protos.js',
].map(
// This makes sure the files are correct on Windows.
path.normalize

View file

@ -336,6 +336,9 @@ const excludedFilesRegexp = RegExp(
'^node_modules/webpack-hot-middleware/.+',
'^node_modules/webpack-merge/.+',
'^node_modules/webpack/.+',
// Sticker Creator
'^sticker-creator/.+',
].join('|')
);

View file

@ -0,0 +1,14 @@
// Copyright 2023 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { contextBridge, ipcRenderer } from 'electron';
contextBridge.exposeInMainWorld('getCredentials', async () =>
ipcRenderer.invoke('get-art-creator-auth')
);
contextBridge.exposeInMainWorld(
'installStickerPack',
(packId: string, key: string) =>
ipcRenderer.invoke('install-sticker-pack', packId, key)
);