Move sticker creator API to chat service
This commit is contained in:
parent
a1e090d1f1
commit
31cbb89b0d
21 changed files with 124 additions and 587 deletions
|
@ -341,24 +341,6 @@ ipc.on('show-group-via-link', (_event, info) => {
|
|||
drop(window.Events.showGroupViaLink?.(info.value));
|
||||
});
|
||||
|
||||
ipc.on('open-art-creator', () => {
|
||||
drop(window.Events.openArtCreator());
|
||||
});
|
||||
|
||||
window.openArtCreator = ({
|
||||
username,
|
||||
password,
|
||||
}: {
|
||||
username: string;
|
||||
password: string;
|
||||
}) => {
|
||||
return ipc.invoke('open-art-creator', { username, password });
|
||||
};
|
||||
|
||||
ipc.on('authorize-art-creator', (_event, info) => {
|
||||
window.Events.authorizeArtCreator?.(info);
|
||||
});
|
||||
|
||||
ipc.on('start-call-lobby', (_event, { conversationId }) => {
|
||||
window.IPC.showWindow();
|
||||
window.reduxActions?.calling?.startCallingLobby({
|
||||
|
@ -458,3 +440,18 @@ ipc.on('show-release-notes', () => {
|
|||
showReleaseNotes();
|
||||
}
|
||||
});
|
||||
|
||||
ipc.on(
|
||||
'art-creator:uploadStickerPack',
|
||||
async (
|
||||
event,
|
||||
{
|
||||
manifest,
|
||||
stickers,
|
||||
}: { manifest: Uint8Array; stickers: ReadonlyArray<Uint8Array> }
|
||||
) => {
|
||||
const packId = await window.Events?.uploadStickerPack(manifest, stickers);
|
||||
|
||||
event.sender.send('art-creator:uploadStickerPack:done', packId);
|
||||
}
|
||||
);
|
||||
|
|
|
@ -27,7 +27,6 @@ window.WebAPI = window.textsecure.WebAPI.initialize({
|
|||
storageUrl: config.storageUrl,
|
||||
updatesUrl: config.updatesUrl,
|
||||
resourcesUrl: config.resourcesUrl,
|
||||
artCreatorUrl: config.artCreatorUrl,
|
||||
directoryConfig: config.directoryConfig,
|
||||
cdnUrlObject: {
|
||||
0: config.cdnUrl0,
|
||||
|
|
|
@ -3,8 +3,26 @@
|
|||
|
||||
import { contextBridge, ipcRenderer } from 'electron';
|
||||
|
||||
contextBridge.exposeInMainWorld('getCredentials', async () =>
|
||||
ipcRenderer.invoke('get-art-creator-auth')
|
||||
let onProgress: (() => void) | undefined;
|
||||
|
||||
ipcRenderer.on('art-creator:onUploadProgress', () => {
|
||||
onProgress?.();
|
||||
});
|
||||
|
||||
contextBridge.exposeInMainWorld(
|
||||
'uploadStickerPack',
|
||||
async (
|
||||
manifest: Uint8Array,
|
||||
stickers: Readonly<Uint8Array>,
|
||||
newOnProgress: (() => void) | undefined
|
||||
): Promise<string> => {
|
||||
onProgress = newOnProgress;
|
||||
|
||||
return ipcRenderer.invoke('art-creator:uploadStickerPack', {
|
||||
manifest,
|
||||
stickers,
|
||||
});
|
||||
}
|
||||
);
|
||||
|
||||
contextBridge.exposeInMainWorld(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue