mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
chore: Use isDevEnv() and isTestEnv() (#9264)
All checks were successful
Tests / test (push) Successful in 4m50s
All checks were successful
Tests / test (push) Successful in 4m50s
Signed-off-by: Mark Tolmacs <mark@lazycat.hu> Co-authored-by: Mark Tolmacs <mark@lazycat.hu>
This commit is contained in:
parent
77aca48c84
commit
e1bb59fb8f
16 changed files with 48 additions and 45 deletions
|
@ -6,7 +6,7 @@ import {
|
|||
reconcileElements,
|
||||
} from "@excalidraw/excalidraw";
|
||||
import { ErrorDialog } from "@excalidraw/excalidraw/components/ErrorDialog";
|
||||
import { APP_NAME, ENV, EVENT } from "@excalidraw/excalidraw/constants";
|
||||
import { APP_NAME, EVENT } from "@excalidraw/excalidraw/constants";
|
||||
import {
|
||||
IDLE_THRESHOLD,
|
||||
ACTIVE_THRESHOLD,
|
||||
|
@ -24,6 +24,8 @@ import { t } from "@excalidraw/excalidraw/i18n";
|
|||
import { withBatchedUpdates } from "@excalidraw/excalidraw/reactUtils";
|
||||
import {
|
||||
assertNever,
|
||||
isDevEnv,
|
||||
isTestEnv,
|
||||
preventUnload,
|
||||
resolvablePromise,
|
||||
throttleRAF,
|
||||
|
@ -240,7 +242,7 @@ class Collab extends PureComponent<CollabProps, CollabState> {
|
|||
|
||||
appJotaiStore.set(collabAPIAtom, collabAPI);
|
||||
|
||||
if (import.meta.env.MODE === ENV.TEST || import.meta.env.DEV) {
|
||||
if (isTestEnv() || isDevEnv()) {
|
||||
window.collab = window.collab || ({} as Window["collab"]);
|
||||
Object.defineProperties(window, {
|
||||
collab: {
|
||||
|
@ -1013,7 +1015,7 @@ declare global {
|
|||
}
|
||||
}
|
||||
|
||||
if (import.meta.env.MODE === ENV.TEST || import.meta.env.DEV) {
|
||||
if (isTestEnv() || isDevEnv()) {
|
||||
window.collab = window.collab || ({} as Window["collab"]);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue