refactor: some minor cleanup
This commit is contained in:
parent
307ca38ecc
commit
858d127246
12 changed files with 84 additions and 59 deletions
10
src/email_providers/utils.py
Normal file
10
src/email_providers/utils.py
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
from playwright.async_api import BrowserContext, Page
|
||||
|
||||
|
||||
async def ensure_page(
|
||||
browser_session: BrowserContext,
|
||||
page: Page | None,
|
||||
) -> Page:
|
||||
if page is None or page.is_closed():
|
||||
return await browser_session.new_page()
|
||||
return page
|
||||
Loading…
Add table
Add a link
Reference in a new issue