Skip to content

Commit

Permalink
Remove usage of page.go_async (#2809)
Browse files Browse the repository at this point in the history
  • Loading branch information
FeodorFitsner authored Mar 6, 2024
1 parent 2e970dd commit 77f10b0
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions sdk/python/packages/flet/src/flet/fastapi/flet_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,8 @@
from datetime import datetime, timedelta
from typing import Any, Dict, List, Optional

from fastapi import WebSocket, WebSocketDisconnect

import flet.fastapi as flet_fastapi
from fastapi import WebSocket, WebSocketDisconnect
from flet.fastapi.flet_app_manager import app_manager
from flet.fastapi.oauth_state import OAuthState
from flet_core.event import Event
Expand Down Expand Up @@ -153,9 +152,7 @@ async def __on_session_created(self, session_data):
traceback.format_exc(),
)
assert self.__page
self.__page.error(
f"There was an error while processing your request: {e}"
)
self.__page.error(f"There was an error while processing your request: {e}")

async def __send_loop(self):
while True:
Expand Down Expand Up @@ -288,7 +285,7 @@ async def __on_message(self, data: str):
)

if original_route != self.__page.route:
await self.__page.go_async(self.__page.route)
self.__page.go(self.__page.route)

elif msg.action == ClientActions.PAGE_EVENT_FROM_WEB:
if self.__on_event is not None:
Expand Down

0 comments on commit 77f10b0

Please sign in to comment.