Skip to content

Commit

Permalink
Merge pull request #22 from KeithLin724/KY-dev-v1
Browse files Browse the repository at this point in the history
KY-dev-v1
  • Loading branch information
KeithLin724 authored Dec 24, 2023
2 parents 3b2e6f4 + 848d2d0 commit e5bd13f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Book_To_Comics_Client/components/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def error_board(service: str = "connect") -> rx.Component:
)
if service == "connect"
else rx.cond(
not State.check_service(service),
rx.alert(
condition=State.service_provide[service] == {},
c1=rx.alert(
rx.alert_icon(),
rx.alert_title("Server is not provide this service"),
status="error",
Expand Down
6 changes: 5 additions & 1 deletion Book_To_Comics_Client/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,10 @@ async def check_server_state(self):

service_provide: dict

def check_service(self, service):
def service_is_not_provider(self, service):
return service not in self.service_provide

def service_is_provider(self, service):
return service in self.service_provide

async def get_server_service(self):
Expand All @@ -64,6 +67,7 @@ async def get_server_service(self):
self.connect_server = True

self.service_provide = response.json()
# yield rx.console_log(self.service_provide["text_to_image"])

except httpx.ConnectError as e:
yield rx.console_log(f"connect server error{e}")
Expand Down

0 comments on commit e5bd13f

Please sign in to comment.