Skip to content

Commit

Permalink
state:set
Browse files Browse the repository at this point in the history
  • Loading branch information
ceddybi committed Mar 5, 2024
1 parent 6c13337 commit 045ae90
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/config/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ export const gotoMainPage = async (url: string) => {

const browser = await getBrowser();
const page = await browser.newPage();
await page.setViewport({ width: 1400, height: 800 });

const ctx = {
getState,
Expand Down Expand Up @@ -86,6 +87,7 @@ export const gotoAppPage = async (job: AppJob) => {
const resume = await getResume();
const browser = await getBrowser();
const page = await browser.newPage();
await page.setViewport({ width: 1400, height: 800 });

const close = () => {
appEvents.emit(APPEVENTS.APP_STOP, job.id);
Expand Down
1 change: 1 addition & 0 deletions src/config/browser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export const getBrowser = async () => {
browser = await puppeteer.launch({
headless: false,
args: [
// `--window-size=1920,1080`,
'--disable-extensions',
'--disable-gpu',
'--disable-dev-shm-usage',
Expand Down
5 changes: 5 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,11 @@ ipcMain.handle('state', async (event) => {
return state;
});

ipcMain.handle('state:set', async (event, newState: BEState) => {
const state = await setState(newState);
return state;
});

ipcMain.handle('questions:read', async (event, question) => {
// console.log("questions:read", question);
const savedQuestion = await readQuestion(question as any);
Expand Down

0 comments on commit 045ae90

Please sign in to comment.