Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

handle stuck progress bar #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions source/TUI/index.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from webbrowser import open

from asyncio import get_event_loop
# from asyncio import sleep
from pyperclip import paste
from rich.text import Text
Expand Down Expand Up @@ -105,8 +105,8 @@ def close_disclaimer(self):
self.disclaimer = False

@on(Button.Pressed, "#deal")
async def deal_button(self):
await self.deal()
def deal_button(self):
get_event_loop().create_task(self.deal())

@on(Button.Pressed, "#reset")
def reset_button(self):
Expand All @@ -118,8 +118,6 @@ def paste_button(self):

@show_state
async def deal(self):
# TODO: 处理过程中,进度条异常卡顿,待排查!
# await sleep(2)
if not self.url.value:
self.tip.write(Text(self.prompt.invalid_link, style=WARNING))
return
Expand Down