Skip to content

Commit

Permalink
Fix sticker-creator
Browse files Browse the repository at this point in the history
Co-authored-by: Fedor Indutny <79877362+indutny-signal@users.noreply.github.com>
  • Loading branch information
automated-signal and indutny-signal committed Oct 18, 2021
1 parent 5ae1783 commit 01d9dc3
Showing 1 changed file with 6 additions and 14 deletions.
20 changes: 6 additions & 14 deletions sticker-creator/preload.js
Expand Up @@ -11,7 +11,7 @@ const { noop, uniqBy } = require('lodash');
const pMap = require('p-map');

// It is important to call this as early as possible
require('../ts/windows/context');
const { SignalContext } = require('../ts/windows/context');

const {
deriveStickerPackKey,
Expand All @@ -20,11 +20,7 @@ const {
} = require('../ts/Crypto');
const Bytes = require('../ts/Bytes');
const { SignalService: Proto } = require('../ts/protobuf');
const {
getEnvironment,
setEnvironment,
parseEnvironment,
} = require('../ts/environment');
const { getEnvironment } = require('../ts/environment');
const { createSetting } = require('../ts/util/preload');

const { dialog } = remote;
Expand All @@ -35,8 +31,6 @@ const MAX_STICKER_DIMENSION = STICKER_SIZE;
const MAX_WEBP_STICKER_BYTE_LENGTH = 100 * 1024;
const MAX_ANIMATED_STICKER_BYTE_LENGTH = 300 * 1024;

setEnvironment(parseEnvironment(config.environment));

window.ROOT_PATH = window.location.href.startsWith('file') ? '../../' : '/';
window.getEnvironment = getEnvironment;
window.getVersion = () => config.version;
Expand All @@ -46,11 +40,9 @@ window.Backbone = require('backbone');

window.localeMessages = ipc.sendSync('locale-data');

require('../ts/logging/set_up_renderer_logging').initialize();

require('../ts/SignalProtocolStore');

window.SignalWindow.log.info('sticker-creator starting up...');
SignalContext.log.info('sticker-creator starting up...');

const Signal = require('../js/modules/signal');

Expand Down Expand Up @@ -261,7 +253,7 @@ const getThemeSetting = createSetting('theme-setting');
async function resolveTheme() {
const theme = (await getThemeSetting.getValue()) || 'system';
if (process.platform === 'darwin' && theme === 'system') {
const { theme: nativeTheme } = window.SignalContext.nativeThemeListener;
const { theme: nativeTheme } = SignalContext.nativeThemeListener;
return nativeTheme.shouldUseDarkColors ? 'dark' : 'light';
}
return theme;
Expand All @@ -275,6 +267,6 @@ async function applyTheme() {

window.addEventListener('DOMContentLoaded', applyTheme);

window.SignalContext.nativeThemeListener.subscribe(() => applyTheme());
SignalContext.nativeThemeListener.subscribe(() => applyTheme());

window.SignalWindow.log.info('sticker-creator preload complete...');
SignalContext.log.info('sticker-creator preload complete...');

0 comments on commit 01d9dc3

Please sign in to comment.