From 2f0d635b73fcbe2cb0f0a1270b331aa69e514327 Mon Sep 17 00:00:00 2001 From: Diego Imbert <70353967+diegoimbert@users.noreply.github.com> Date: Thu, 23 Oct 2025 11:50:17 +0200 Subject: [PATCH] Sync RT button (#6882) --- .../src/lib/components/AppConnectInner.svelte | 54 +++++++++++++------ frontend/src/lib/svelte5Utils.svelte.ts | 5 +- 2 files changed, 41 insertions(+), 18 deletions(-) diff --git a/frontend/src/lib/components/AppConnectInner.svelte b/frontend/src/lib/components/AppConnectInner.svelte index 5d94f87a57..817a6f4f16 100644 --- a/frontend/src/lib/components/AppConnectInner.svelte +++ b/frontend/src/lib/components/AppConnectInner.svelte @@ -1,14 +1,15 @@ {#if !express} @@ -577,20 +597,11 @@ {#if connectsManual && connectsManual?.length < 10}
- Resource Types have not been synced with the hub. Go to the admins workspace to sync them - (and add a schedule to do daily): -

1. Go to the "admins" workspaces: - sync resource types -

-

- 2: Run the synchronization script: - sync resource types -

+ Resource Types have not been synced with the hub
{/if} -
+
{#if filteredConnectsManual} {#each filteredConnectsManual as { key }} {#if nativeLanguagesCategory.includes(key)} @@ -609,9 +620,6 @@ {/if} {/each} {/if} -
- -
{#if filteredConnectsManual} {#each filteredConnectsManual as { key }} {#if !nativeLanguagesCategory.includes(key)} @@ -639,6 +647,20 @@ {/each} {/if}
+ {#if $superadmin} + + {#if hubRtSync.status === 'error'} + + Error syncing resource types : {JSON.stringify(hubRtSync.error)} + + {/if} + {/if} {:else if step == 2 && manual}
= ( | { status: 'loading'; value?: undefined; error?: undefined } | { status: 'error'; error: any; value?: undefined } | { status: 'ok'; value: T; error?: undefined } + | { status: 'idle'; value?: undefined; error?: undefined } ) & { refresh: () => void clear: () => void @@ -43,7 +44,7 @@ export function usePromise( { loadInit = true, clearValueOnRefresh = true }: UsePromiseOptions = {} ): UsePromiseResult { const ret: any = $state({ - status: 'loading', + status: 'idle', __promise: undefined, refresh: () => { untrack(() => { @@ -67,7 +68,7 @@ export function usePromise( }) }, clear: () => { - ret.status = 'loading' + ret.status = loadInit ? 'loading' : 'idle' ret.value = undefined ret.error = undefined ret.__promise = undefined