mirror of
https://github.com/hellodigua/ChatLab.git
synced 2026-10-25 17:54:34 +08:00
fix(ui): spin sync icon in-place instead of showing separate loader
Replace UButton :loading with animate-spin on the arrow-path icon itself. The sync button's icon now rotates when syncing, and the button is disabled. The "sync all" button is also disabled when any session is syncing.
This commit is contained in:
1 parent
811bb3c09a
commit
92c8a795f9
1 file changed
+13
-5
@@ -270,11 +270,16 @@ function subscribedRemoteIds(ds: DataSource): Set<string> {
|
||||
<UButton
|
||||
size="xs"
|
||||
variant="ghost"
|
||||
:loading="pullingIds.has(ds.id)"
|
||||
:disabled="pullingIds.has(ds.id)"
|
||||
:disabled="pullingIds.has(ds.id) || ds.sessions.some((s) => pullingIds.has(s.id))"
|
||||
@click="syncAllInSource(ds)"
|
||||
>
|
||||
<UIcon name="i-heroicons-arrow-path" class="h-3.5 w-3.5" />
|
||||
<UIcon
|
||||
name="i-heroicons-arrow-path"
|
||||
class="h-3.5 w-3.5"
|
||||
:class="{
|
||||
'animate-spin': pullingIds.has(ds.id) || ds.sessions.some((s) => pullingIds.has(s.id)),
|
||||
}"
|
||||
/>
|
||||
</UButton>
|
||||
<UButton
|
||||
size="xs"
|
||||
@@ -315,11 +320,14 @@ function subscribedRemoteIds(ds: DataSource): Set<string> {
|
||||
<UButton
|
||||
size="xs"
|
||||
variant="ghost"
|
||||
:loading="pullingIds.has(sess.id)"
|
||||
:disabled="pullingIds.has(sess.id)"
|
||||
@click="syncSession(ds, sess)"
|
||||
>
|
||||
<UIcon name="i-heroicons-arrow-path" class="h-3.5 w-3.5" />
|
||||
<UIcon
|
||||
name="i-heroicons-arrow-path"
|
||||
class="h-3.5 w-3.5"
|
||||
:class="{ 'animate-spin': pullingIds.has(sess.id) }"
|
||||
/>
|
||||
</UButton>
|
||||
<UButton
|
||||
size="xs"
|
||||
|
||||
Reference in new issue
Block a user