Skip to content

✨ Innovative and open-source visualization application that transforms various data formats, such as JSON, YAML, XML and CSV into interactive graphs.

fix StorageConfig type

AykutSaracd199495c4b99
diff --git a/src/constants/data.ts b/src/constants/data.ts
index e0cc60bd..f6e63fe9 100644
--- a/src/constants/data.ts
+++ b/src/constants/data.ts
@@ -33,7 +33,7 @@ export const defaultJson = {
],
};
-export const defaultConfig: Partial<StorageConfig> = {
+export const defaultConfig: StorageConfig = {
layout: "LEFT",
expand: true,
autoformat: true,
diff --git a/src/reducer/reducer.ts b/src/reducer/reducer.ts
index 20b61956..3d66169b 100644
--- a/src/reducer/reducer.ts
+++ b/src/reducer/reducer.ts
@@ -25,6 +25,8 @@ export const useConfigReducer: React.Reducer<AppConfig, ReducerAction> = (
state = initialStates,
action
) => {
+ if (!state.settings.zoomPanPinch) return state;
+
switch (action.type) {
case ConfigActionType.SET_CONFIG:
return { ...state, settings: action.payload };
diff --git a/src/typings/global.ts b/src/typings/global.ts
index f602df05..6a9fea65 100644
--- a/src/typings/global.ts
+++ b/src/typings/global.ts
@@ -7,5 +7,5 @@ export interface StorageConfig {
autoformat: boolean;
hideEditor: boolean;
searchNode: string;
- zoomPanPinch: ReactZoomPanPinchRef;
+ zoomPanPinch?: ReactZoomPanPinchRef;
}