Part of #11855. Instead of getting the Google Maps API Key from runtime env variables, we get it from the server, as part of the response of `/api/v1/tenant/current`. This doesn't add a database call, just include the env variable name in the response, so shouldn't have any performance impact on the API. On the client though, the Maps API key won't be available, until at least the first call to `/tenant/current` is finished. Also, first big PR in client code. 🙂 Edit: not `/me` anymore, but from `/tenant/current`. --------- Co-authored-by: Pawan Kumar <pawan.stardust@gmail.com> Co-authored-by: Aishwarya UR <aishwarya@appsmith.com>
20 lines
877 B
TypeScript
20 lines
877 B
TypeScript
import { AppState } from "@appsmith/reducers";
|
|
import { User } from "constants/userConstants";
|
|
import { PropertyPanePositionConfig } from "reducers/uiReducers/usersReducer";
|
|
|
|
export const getCurrentUser = (state: AppState): User | undefined =>
|
|
state.ui?.users?.currentUser;
|
|
export const getCurrentUserLoading = (state: AppState): boolean =>
|
|
state.ui.users.loadingStates.fetchingUser;
|
|
export const getUserAuthError = (state: AppState): string =>
|
|
state.ui.users.error;
|
|
export const getUsers = (state: AppState): User[] => state.ui.users.users;
|
|
export const getProppanePreference = (
|
|
state: AppState,
|
|
): PropertyPanePositionConfig | undefined => state.ui.users.propPanePreferences;
|
|
export const getFeatureFlagsFetched = (state: AppState) =>
|
|
state.ui.users.featureFlag.isFetched;
|
|
|
|
export const selectFeatureFlags = (state: AppState) =>
|
|
state.ui.users.featureFlag.data;
|