fix(core): fix auth session not revalidating as expected (#8886)

This commit is contained in:
EYHN
2024-11-21 09:57:25 +00:00
parent a4c749b882
commit 76eabf644c

View File

@@ -2,13 +2,14 @@ import {
backoffRetry, backoffRetry,
effect, effect,
Entity, Entity,
exhaustMapWithTrailing,
fromPromise, fromPromise,
LiveData, LiveData,
onComplete, onComplete,
onStart, onStart,
} from '@toeverything/infra'; } from '@toeverything/infra';
import { isEqual } from 'lodash-es'; import { isEqual } from 'lodash-es';
import { EMPTY, exhaustMap, mergeMap } from 'rxjs'; import { EMPTY, mergeMap } from 'rxjs';
import { validateAndReduceImage } from '../../../utils/reduce-image'; import { validateAndReduceImage } from '../../../utils/reduce-image';
import type { AccountProfile, AuthStore } from '../stores/auth'; import type { AccountProfile, AuthStore } from '../stores/auth';
@@ -66,7 +67,7 @@ export class AuthSession extends Entity {
} }
revalidate = effect( revalidate = effect(
exhaustMap(() => exhaustMapWithTrailing(() =>
fromPromise(this.getSession()).pipe( fromPromise(this.getSession()).pipe(
backoffRetry({ backoffRetry({
count: Infinity, count: Infinity,