Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
mkorpela committed Apr 18, 2022
1 parent 05a1f0b commit 8bf8a3b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
6 changes: 6 additions & 0 deletions node/dynamic-test-app/src/draggame.tsx
@@ -1,6 +1,12 @@
import Draggable, { DraggableData, DraggableEvent } from 'react-draggable';
import React, { useState } from 'react';

declare module 'react-draggable' {
export interface DraggableProps {
children: React.ReactNode;
}
}

export function DragGame() {
const goal = {
top: 500,
Expand Down
12 changes: 6 additions & 6 deletions node/playwright-wrapper/playwright-state.ts
Expand Up @@ -206,15 +206,15 @@ function indexedPage(newPage: Page) {
}

async function _newPage(context: IndexedContext, page: Page | undefined = undefined): Promise<IndexedPage> {
const newPage = ((page === undefined) ? await context.c.newPage() : page);
const newPage = page === undefined ? await context.c.newPage() : page;
const contextPage = indexedPage(newPage);
newPage.on('close', () => {
const oldPageStackLength = context.pageStack.length
const filteredPageStack = context.pageStack.filter((page: IndexedPage) => page.p != contextPage.p)
const oldPageStackLength = context.pageStack.length;
const filteredPageStack = context.pageStack.filter((page: IndexedPage) => page.p != contextPage.p);

if(oldPageStackLength != filteredPageStack.length) {
context.pageStack = filteredPageStack
logger.info("Removed " + contextPage.id + " from " + context.id + " page stack")
if (oldPageStackLength != filteredPageStack.length) {
context.pageStack = filteredPageStack;
logger.info('Removed ' + contextPage.id + ' from ' + context.id + ' page stack');
}
});
return contextPage;
Expand Down

0 comments on commit 8bf8a3b

Please sign in to comment.