Skip to content

Commit

Permalink
Fix twitch embed issue
Browse files Browse the repository at this point in the history
willie-yao committed Apr 8, 2023
1 parent f282508 commit 44e5279
Showing 2 changed files with 8 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/main/main.ts
Original file line number Diff line number Diff line change
@@ -263,6 +263,7 @@ ipcMain.on('electron-store-get-secret', async (event, val) => {
});

ipcMain.on('ipc-example', async (event, arg) => {
store.set('apikey', process.env.STARTGG_API_KEY);
const msgTemplate = (pingPong: string) => `IPC test: ${pingPong}`;
console.log(msgTemplate(arg));
event.reply('ipc-example', msgTemplate('pong'));
@@ -400,8 +401,6 @@ app
if (mainWindow === null) createWindow();
});

store.set('apikey', process.env.STARTGG_API_KEY);

// works for dumb iFrames
session.defaultSession.webRequest.onHeadersReceived({
urls: [
7 changes: 7 additions & 0 deletions src/renderer/index.tsx
Original file line number Diff line number Diff line change
@@ -4,3 +4,10 @@ import App from './App';
const container = document.getElementById('root')!;
const root = createRoot(container);
root.render(<App />);

// calling IPC exposed from preload script
window.electron.ipcRenderer.once('ipc-example', (arg) => {
// eslint-disable-next-line no-console
console.log(arg);
});
window.electron.ipcRenderer.sendMessage('ipc-example', ['ping']);

0 comments on commit 44e5279

Please sign in to comment.