diff --git a/client/package.json b/client/package.json index c1cb5cc..0e06bc5 100644 --- a/client/package.json +++ b/client/package.json @@ -18,6 +18,7 @@ "js-cookie": "^2.2.1", "lodash": "^4.17.19", "node-sass": "^4.14.1", + "protobufjs": "^6.10.2", "react": "^16.14.0", "react-dom": "^16.14.0", "react-modal": "^3.11.2", diff --git a/client/src/services/apiProxy.ts b/client/src/services/apiProxy.ts index 48b3b26..5f657b2 100644 --- a/client/src/services/apiProxy.ts +++ b/client/src/services/apiProxy.ts @@ -63,7 +63,7 @@ async function requestInner(path: string, params?: any, autoLogoutOnAuthError = export async function request(path: string, params?: any, autoLogoutOnAuthError = true) { - if (isProtoEligible(path) && isProtoEnabled) { + if (isProtoEligible(path) && isProtoEnabled()) { return requestProto(path, params, autoLogoutOnAuthError).then((value => { return parser(new Uint8Array(value)); })); diff --git a/client/src/utils/protoHelpers.ts b/client/src/utils/protoHelpers.ts index 8c22246..61d37d1 100644 --- a/client/src/utils/protoHelpers.ts +++ b/client/src/utils/protoHelpers.ts @@ -49,7 +49,7 @@ export function parser(raw: Uint8Array) { } } -export function isProtoEnabled(url: string): boolean { +export function isProtoEnabled(): boolean { return window.localStorage.getItem('protoEnabled') === 'true'; }