Remove Sticker Creator in favor of Web App
This commit is contained in:
parent
78f0626e68
commit
f84b6a31dc
117 changed files with 67 additions and 5269 deletions
85
app/main.ts
85
app/main.ts
|
@ -95,7 +95,7 @@ import type { MenuActionType } from '../ts/types/menu';
|
|||
import { createTemplate } from './menu';
|
||||
import { installFileHandler, installWebHandler } from './protocol_filter';
|
||||
import * as OS from '../ts/OS';
|
||||
import { isProduction, isStaging } from '../ts/util/version';
|
||||
import { isProduction } from '../ts/util/version';
|
||||
import {
|
||||
isSgnlHref,
|
||||
isCaptchaHref,
|
||||
|
@ -1342,85 +1342,6 @@ async function getIsLinked() {
|
|||
}
|
||||
}
|
||||
|
||||
let stickerCreatorWindow: BrowserWindow | undefined;
|
||||
async function showStickerCreator() {
|
||||
if (!(await getIsLinked())) {
|
||||
const message = getResolvedMessagesLocale().i18n(
|
||||
'StickerCreator--Authentication--error'
|
||||
);
|
||||
|
||||
await dialog.showMessageBox({
|
||||
type: 'warning',
|
||||
message,
|
||||
});
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
if (stickerCreatorWindow) {
|
||||
stickerCreatorWindow.show();
|
||||
return;
|
||||
}
|
||||
|
||||
const { x = 0, y = 0 } = windowConfig || {};
|
||||
|
||||
const titleBarOverlay = await getTitleBarOverlay();
|
||||
|
||||
const options = {
|
||||
x: x + 100,
|
||||
y: y + 100,
|
||||
width: 800,
|
||||
minWidth: 800,
|
||||
height: 650,
|
||||
title: getResolvedMessagesLocale().i18n('signalDesktopStickerCreator'),
|
||||
titleBarStyle: nonMainTitleBarStyle,
|
||||
titleBarOverlay,
|
||||
autoHideMenuBar: true,
|
||||
backgroundColor: await getBackgroundColor(),
|
||||
show: false,
|
||||
webPreferences: {
|
||||
...defaultWebPrefs,
|
||||
nodeIntegration: false,
|
||||
nodeIntegrationInWorker: false,
|
||||
sandbox: false,
|
||||
contextIsolation: false,
|
||||
preload: join(__dirname, '../sticker-creator/preload.js'),
|
||||
nativeWindowOpen: true,
|
||||
spellcheck: await getSpellCheckSetting(),
|
||||
},
|
||||
};
|
||||
|
||||
stickerCreatorWindow = new BrowserWindow(options);
|
||||
setupSpellChecker(stickerCreatorWindow, getResolvedMessagesLocale());
|
||||
|
||||
handleCommonWindowEvents(stickerCreatorWindow, titleBarOverlay);
|
||||
|
||||
const appUrl = process.env.SIGNAL_ENABLE_HTTP
|
||||
? prepareUrl(
|
||||
new URL('http://localhost:6380/sticker-creator/dist/index.html')
|
||||
)
|
||||
: prepareFileUrl([__dirname, '../sticker-creator/dist/index.html']);
|
||||
|
||||
stickerCreatorWindow.on('closed', () => {
|
||||
stickerCreatorWindow = undefined;
|
||||
});
|
||||
|
||||
stickerCreatorWindow.once('ready-to-show', () => {
|
||||
if (!stickerCreatorWindow) {
|
||||
return;
|
||||
}
|
||||
|
||||
stickerCreatorWindow.show();
|
||||
|
||||
if (config.get<boolean>('openDevTools')) {
|
||||
// Open the DevTools.
|
||||
stickerCreatorWindow.webContents.openDevTools();
|
||||
}
|
||||
});
|
||||
|
||||
await safeLoadURL(stickerCreatorWindow, await appUrl);
|
||||
}
|
||||
|
||||
async function openArtCreator() {
|
||||
if (!(await getIsLinked())) {
|
||||
const message = getResolvedMessagesLocale().i18n(
|
||||
|
@ -2013,7 +1934,6 @@ function setupMenu(options?: Partial<CreateTemplateOptionsType>) {
|
|||
devTools: defaultWebPrefs.devTools,
|
||||
includeSetup: false,
|
||||
isProduction: isProduction(app.getVersion()),
|
||||
isStaging: isStaging(app.getVersion()),
|
||||
platform,
|
||||
|
||||
// actions
|
||||
|
@ -2030,7 +1950,6 @@ function setupMenu(options?: Partial<CreateTemplateOptionsType>) {
|
|||
showDebugLog: showDebugLogWindow,
|
||||
showKeyboardShortcuts,
|
||||
showSettings: showSettingsWindow,
|
||||
showStickerCreator,
|
||||
showWindow,
|
||||
|
||||
// overrides
|
||||
|
@ -2642,8 +2561,6 @@ ipc.handle('executeMenuAction', async (_event, action: MenuActionType) => {
|
|||
showKeyboardShortcuts();
|
||||
} else if (action === 'showSettings') {
|
||||
drop(showSettingsWindow());
|
||||
} else if (action === 'showStickerCreator') {
|
||||
drop(showStickerCreator());
|
||||
} else if (action === 'showWindow') {
|
||||
showWindow();
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue