Skip to content

Commit

Permalink
avoid timeout error when loading dependency after startup
Browse files Browse the repository at this point in the history
  • Loading branch information
falkoschindler committed Sep 22, 2022
1 parent 66f6b95 commit 1172ff5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion nicegui/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,5 +89,5 @@ def add_dependencies(py_filepath: str, dependencies: List[str] = []) -> None:
async def reload() -> None:
for page in get_current_view().pages.values():
assert isinstance(page, Page)
await page.await_javascript('location.reload()')
await page.await_javascript('console.log("RELOAD"); location.reload()')
create_task(reload())
1 change: 1 addition & 0 deletions tests/test_dependencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ def page():
srcs = user.get_attributes('script', 'src')
assert any(s.endswith('joystick.js') for s in srcs)
assert any(s.endswith('nipplejs.min.js') for s in srcs)
user.sleep(2) # NOTE we need to sleep here so the js timeout error is printed (start pytest with -s to see it)


def test_keyboard_dependency_before_startup(user: User):
Expand Down

0 comments on commit 1172ff5

Please sign in to comment.