From e7892071381da8f5694b0d55e4f1ae0c8b9b0602 Mon Sep 17 00:00:00 2001 From: Andrey Sobolev Date: Fri, 3 Feb 2023 19:23:19 +0700 Subject: [PATCH] Fix Chunter infinite spinner. (#2585) Signed-off-by: Andrey Sobolev --- .../src/components/AttachmentRefInput.svelte | 8 ++++++-- .../chunter-resources/src/components/ChannelView.svelte | 4 +++- .../chunter-resources/src/components/CommentInput.svelte | 2 +- plugins/chunter-resources/src/components/Message.svelte | 3 +++ plugins/chunter-resources/src/components/Thread.svelte | 3 +++ .../chunter-resources/src/components/ThreadView.svelte | 3 +++ .../src/components/activity/TxCommentCreate.svelte | 2 +- .../src/components/RequestActions.svelte | 3 +++ plugins/telegram-resources/src/components/Chat.svelte | 3 +++ 9 files changed, 26 insertions(+), 5 deletions(-) diff --git a/plugins/attachment-resources/src/components/AttachmentRefInput.svelte b/plugins/attachment-resources/src/components/AttachmentRefInput.svelte index a9fc603dd4..e67f18ca96 100644 --- a/plugins/attachment-resources/src/components/AttachmentRefInput.svelte +++ b/plugins/attachment-resources/src/components/AttachmentRefInput.svelte @@ -210,8 +210,12 @@ async function onMessage (event: CustomEvent) { loading = true - await createAttachments() - dispatch('message', { message: event.detail, attachments: attachments.size }) + try { + await createAttachments() + dispatch('message', { message: event.detail, attachments: attachments.size }) + } finally { + loading = false + } } async function onUpdate (event: CustomEvent) { diff --git a/plugins/chunter-resources/src/components/ChannelView.svelte b/plugins/chunter-resources/src/components/ChannelView.svelte index 5d5566e335..57d472604e 100644 --- a/plugins/chunter-resources/src/components/ChannelView.svelte +++ b/plugins/chunter-resources/src/components/ChannelView.svelte @@ -75,6 +75,7 @@ _id = generateId() isScrollForced = true + loading = false } function openThread (_id: Ref) { @@ -106,6 +107,7 @@ savedAttachmentsQuery.query(attachment.class.SavedAttachments, {}, (res) => { savedAttachmentsIds = res.map((r) => r.attachedTo) }) + let loading = false @@ -120,7 +122,7 @@ {savedAttachmentsIds} />
- +