fix: use pre watchers with vueuse until

By default, Vue watchers use pre flush timing. However, by default, VueUse uses sync for it's until composable

Signed-off-by: Fernando Fernández <ferferga@hotmail.com>
This commit is contained in:
Fernando Fernández 2024-07-02 01:46:48 +02:00
parent f7f93ec581
commit e5e988e01b
No known key found for this signature in database
GPG Key ID: 82FD36644F1F4D3B
2 changed files with 2 additions and 2 deletions

View File

@ -267,7 +267,7 @@ function _sharedInternalLogic<T extends Record<K, (...args: any[]) => any>, K ex
};
const returnablePromise = async (): Promise<ReturnPayload<T, K, typeof ofBaseItem>> => {
await runNormally();
await until(data).toMatch(d => !isNil(d));
await until(() => isCached.value && !ops.skipCache.request).toBeTruthy({ flush: 'pre' });
return { loading, data };
};

View File

@ -33,7 +33,7 @@ export async function loginGuard(
if (jsonConfig.allowServerSelection) {
destinationRoute = { path: serverSelectUrl, replace: true };
} else {
await until(() => remote.auth.currentServer).toBeTruthy();
await until(() => remote.auth.currentServer).toBeTruthy({ flush: 'pre' });
return loginGuard(to);
}