{renderHeader()}
- {renderBody()}
- {renderButton()}
+ {
+ loading === true ?
+ <>
+
+
{"Loading...."}
+ >
+ :
+ <>
+ {renderBody()}
+ {renderButton()}
+ >
+ }
);
diff --git a/src/fetch-client-ui/components/MainUI/index.tsx b/src/fetch-client-ui/components/MainUI/index.tsx
index f04b703..35b2241 100644
--- a/src/fetch-client-ui/components/MainUI/index.tsx
+++ b/src/fetch-client-ui/components/MainUI/index.tsx
@@ -46,6 +46,7 @@ const MainUI = () => {
const [horiLayout, setHoriLayout] = useState("");
const [saveVisible, setVisible] = useState(false);
+ const [loadingApp, setLoadingApp] = useState(true);
useEffect(() => {
if (loading && resClass === "zero-height") {
@@ -97,16 +98,19 @@ const MainUI = () => {
setLayout(layoutConfig);
let hariLayoutConfig = config["horizontalLayout"];
setHoriLayout(hariLayoutConfig);
+ let responseLimit = (config["responseLimit"] as number) * 1048576;
dispatch(UIActions.SetLayoutAction(layoutConfig === "Horizontal Split" ? true : false, event.data.theme));
+ dispatch(UIActions.SetResponseLimitAction(responseLimit));
} else if (event.data && event.data.type === responseTypes.openExistingItemResponse) {
- const reqData = event.data.item[0] as IRequestModel;
- dispatch(Actions.SetRequestAction(reqData));
+ const reqData = event.data.item[0] as IRequestModel;
+ dispatch(Actions.SetRequestAction(reqData));
if (reqData.body.bodyType === "binary" && reqData.body.binary.fileName) {
vscode.postMessage({ type: requestTypes.readFileRequest, path: reqData.body.binary.fileName });
}
if (reqData.auth.authType === "inherit") {
vscode.postMessage({ type: requestTypes.getParentSettingsRequest, data: { colId: colId, folderId: folderId } });
}
+ setLoadingApp(false);
} else if (event.data && event.data.type === responseTypes.readFileResponse) {
dispatch(Actions.SetRequestBinaryDataAction(event.data.fileData));
} else if (event.data && event.data.type === responseTypes.getAllVariableResponse) {
@@ -123,6 +127,7 @@ const MainUI = () => {
dispatch(ResponseActions.SetResponseAction(event.data.resData.response));
dispatch(ResponseActions.SetResponseHeadersAction(event.data.resData.headers));
dispatch(ResponseActions.SetResponseCookiesAction(event.data.resData.cookies));
+ setLoadingApp(false);
} else if (event.data && event.data.type === responseTypes.saveResponse) {
setVisible(true);
} else if (event.data && event.data.type === responseTypes.getAllCookiesResponse) {
@@ -139,7 +144,7 @@ const MainUI = () => {
vscode.postMessage({ type: requestTypes.themeRequest });
} else if (event.data && event.data.type === responseTypes.themeResponse) {
dispatch(UIActions.SetThemeAction(event.data.theme));
- } else if (event.data && event.data.type === responseTypes.getAllCollectionNameResponse) {
+ } else if (event.data && event.data.type === responseTypes.getAllCollectionNameResponse) {
let col: ICollection[] = event.data.collectionNames?.map((item: { value: any; name: any; }) => {
return {
id: item.value,
@@ -147,7 +152,7 @@ const MainUI = () => {
};
});
col.unshift({ id: "", name: "select" });
- dispatch(Actions.SetCollectionListAction(col));
+ dispatch(Actions.SetCollectionListAction(col));
}
});
@@ -197,7 +202,7 @@ const MainUI = () => {
dispatch(Actions.SetRequestAction(reqData));
isNew = true;
}
- vscode.postMessage({ type: requestTypes.saveRequest, data: { reqData: reqData, isNew: isNew, colId: colId } });
+ vscode.postMessage({ type: requestTypes.saveRequest, data: { reqData: reqData, isNew: isNew, colId: colId === "undefined" ? undefined : colId } });
}
});
@@ -354,56 +359,66 @@ const MainUI = () => {
return (
<>
{
- layout === "Horizontal Split" ?
- horiLayout === "Split Style" ?
-