Skip to content

Commit

Permalink
BC-7171 - Revert some changes to minimize diff
Browse files Browse the repository at this point in the history
  • Loading branch information
bergatco committed Dec 18, 2024
1 parent 0c6319b commit 898aec7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/mapper/configuration.mapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import { TypeGuard } from "../guards/type.guard";
import { Envs } from "../types/Envs";

const checkEnvType = (obj: Record<string, unknown>): void => {
TypeGuard.checkKeyAndValueExists(obj, "TLDRAW_WEBSOCKET_URL");
TypeGuard.checkKeyAndValueExists(obj, "FEATURE_TLDRAW_ENABLED");
TypeGuard.checkKeyAndValueExists(obj, "TLDRAW_ASSETS_ENABLED");
TypeGuard.checkKeyAndValueExists(obj, "TLDRAW_ASSETS_MAX_SIZE_BYTES");
TypeGuard.checkKeyAndValueExists(
obj,
"TLDRAW_ASSETS_ALLOWED_MIME_TYPES_LIST",
);
TypeGuard.checkKeyAndValueExists(obj, "TLDRAW_WEBSOCKET_URL");
TypeGuard.checkKeyAndValueExists(obj, "NOT_AUTHENTICATED_REDIRECT_URL");
TypeGuard.checkBoolean(obj.FEATURE_TLDRAW_ENABLED);
TypeGuard.checkNumber(obj.TLDRAW_ASSETS_MAX_SIZE_BYTES);
Expand All @@ -28,12 +28,12 @@ export class ConfigurationMapper {
const configuration = castToEnv(obj);

const mappedConfiguration: Envs = {
TLDRAW_WEBSOCKET_URL: configuration.TLDRAW_WEBSOCKET_URL,
FEATURE_TLDRAW_ENABLED: configuration.FEATURE_TLDRAW_ENABLED,
TLDRAW_ASSETS_ENABLED: configuration.TLDRAW_ASSETS_ENABLED,
TLDRAW_ASSETS_MAX_SIZE_BYTES: configuration.TLDRAW_ASSETS_MAX_SIZE_BYTES,
TLDRAW_ASSETS_ALLOWED_MIME_TYPES_LIST:
configuration.TLDRAW_ASSETS_ALLOWED_MIME_TYPES_LIST,
TLDRAW_WEBSOCKET_URL: configuration.TLDRAW_WEBSOCKET_URL,
NOT_AUTHENTICATED_REDIRECT_URL:
configuration.NOT_AUTHENTICATED_REDIRECT_URL,
};
Expand Down
2 changes: 1 addition & 1 deletion src/utils/envConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ export const getEnvs = async (): Promise<Envs> => {
throw error;
} else {
const configuration: Envs = {
TLDRAW_WEBSOCKET_URL: "ws://localhost:3345",
FEATURE_TLDRAW_ENABLED: true,
TLDRAW_ASSETS_ENABLED: true,
TLDRAW_ASSETS_MAX_SIZE_BYTES: 10485760,
Expand All @@ -36,7 +37,6 @@ export const getEnvs = async (): Promise<Envs> => {
"image/gif",
"image/svg+xml",
],
TLDRAW_WEBSOCKET_URL: "ws://localhost:3345",
NOT_AUTHENTICATED_REDIRECT_URL: "http://localhost:4000/login",
};

Expand Down

0 comments on commit 898aec7

Please sign in to comment.