improve responsiveness when switching applications
This commit is contained in:
@@ -215,6 +215,7 @@ class ProcessMessageTask(BaseTask):
|
||||
|
||||
class ProcessMessagesTask(BaseTask):
|
||||
message_processed = pyqtSignal(int, gotify.GotifyMessageModel)
|
||||
|
||||
def __init__(self, page: gotify.GotifyPagedMessagesModel):
|
||||
super(ProcessMessagesTask, self).__init__()
|
||||
self.page = page
|
||||
@@ -225,3 +226,6 @@ class ProcessMessagesTask(BaseTask):
|
||||
if image_url := get_image(message.message):
|
||||
downloader.get_filename(image_url)
|
||||
self.message_processed.emit(i, message)
|
||||
|
||||
# Prevent locking up the UI when there are a lot of messages with images ready at the same time
|
||||
time.sleep(0.001)
|
||||
|
||||
Reference in New Issue
Block a user