mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 16:02:26 +00:00
Merge pull request #1326 from PR0M3TH3AN/ai/debug-frontend-20250220-7026139013210056715
Fix frontend console warning for Login Modal initialization race condition
This commit is contained in:
3 files changed
+518
-629
No files matched your search
@@ -395,8 +395,6 @@ export default class ApplicationBootstrap {
|
||||
app.loginModalController = null;
|
||||
app.currentUserNpub = null;
|
||||
|
||||
app.initializeLoginModalController({ logIfMissing: true });
|
||||
|
||||
app.profileButton = doc?.getElementById("profileButton") || null;
|
||||
app.profileAvatar = doc?.getElementById("profileAvatar") || null;
|
||||
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
from playwright.sync_api import sync_playwright
|
||||
import sys
|
||||
import time
|
||||
|
||||
def run():
|
||||
with sync_playwright() as p:
|
||||
browser = p.chromium.launch(headless=True)
|
||||
page = browser.new_page()
|
||||
|
||||
# Subscribe to console messages
|
||||
page.on("console", lambda msg: print(f"console:{msg.type}: {msg.text}"))
|
||||
|
||||
# Subscribe to uncaught exceptions
|
||||
page.on("pageerror", lambda exc: print(f"pageerror: {exc}"))
|
||||
|
||||
# Subscribe to failed network requests
|
||||
page.on("requestfailed", lambda req: print(f"requestfailed: {req.url} {req.failure}"))
|
||||
|
||||
try:
|
||||
# Navigate to localhost
|
||||
page.goto("http://localhost:8000", wait_until="networkidle")
|
||||
# Wait a bit for async operations
|
||||
time.sleep(2)
|
||||
except Exception as e:
|
||||
print(f"Error navigating: {e}")
|
||||
finally:
|
||||
browser.close()
|
||||
|
||||
if __name__ == "__main__":
|
||||
run()
|
||||
+488
-627
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user