mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-27 02:42:25 +08:00
fix(core): fix auth session not revalidating as expected (#8886)
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user