2021-08-09 09:04:24 +00:00
|
|
|
import { createSelector } from "reselect";
|
|
|
|
|
import { AppState } from "reducers";
|
|
|
|
|
import { AppCollabReducerState } from "reducers/uiReducers/appCollabReducer";
|
|
|
|
|
import { getCurrentUser } from "./usersSelectors";
|
2021-08-26 06:56:13 +00:00
|
|
|
import getFeatureFlags from "../utils/featureFlags";
|
2021-08-09 09:04:24 +00:00
|
|
|
|
|
|
|
|
export const getAppCollabState = (state: AppState) => state.ui.appCollab;
|
|
|
|
|
|
|
|
|
|
export const getRealtimeAppEditors = createSelector(
|
|
|
|
|
getAppCollabState,
|
|
|
|
|
getCurrentUser,
|
|
|
|
|
(appCollab: AppCollabReducerState, currentUser) =>
|
|
|
|
|
appCollab.editors.filter((el) => el.email !== currentUser?.email),
|
|
|
|
|
);
|
2021-08-26 06:56:13 +00:00
|
|
|
|
|
|
|
|
export const isMultiplayerEnabledForUser = () => getFeatureFlags().MULTIPLAYER;
|