mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-01 09:30:01 +08:00
perf: getEnvironment() -> env (#2636)
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { getEnvironment } from '@affine/env/config';
|
||||
import { env } from '@affine/env/config';
|
||||
import { atomWithObservable, atomWithStorage } from 'jotai/utils';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
@@ -21,9 +21,8 @@ function rpcToObservable<
|
||||
) {
|
||||
return new Observable<T>(subscriber => {
|
||||
subscriber.next(initialValue);
|
||||
const environment = getEnvironment();
|
||||
onSubscribe?.();
|
||||
if (typeof window === 'undefined' || !environment.isDesktop || !event) {
|
||||
if (typeof window === 'undefined' || !env.isDesktop || !event) {
|
||||
subscriber.complete();
|
||||
return () => {};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user