Fixed multiple issues with how files are downloaded and uploaded

This commit is contained in:
frikky
2022-08-24 01:01:54 +02:00
parent 41945f79b2
commit 546e752705
7 changed files with 55 additions and 63 deletions
+10 -17
View File
@@ -1338,20 +1338,18 @@ const Admin = (props) => {
const downloadFile = (file) => {
fetch(globalUrl + "/api/v1/files/" + file.id + "/content", {
method: "GET",
headers: {
"Content-Type": "application/json",
Accept: "application/json",
},
credentials: "include",
})
.then((response) => {
if (response.status !== 200) {
console.log("Status not 200 for apps :O!");
return "";
}
.then((response) => {
if (response.status !== 200) {
console.log("Status not 200 for apps :O!");
return "";
}
return response.text();
})
console.log("Resp: ", response)
return response.blob()
})
.then((respdata) => {
if (respdata.length === 0) {
alert.error("Failed getting file. Is it deleted?");
@@ -1591,18 +1589,13 @@ const Admin = (props) => {
document.title = "Shuffle - admin";
}
console.log("NEWVALUE: ", newValue);
if (newValue === 6) {
console.log("Should get apps for categories.");
}
console.log("PROPS: ", props);
navigate(`/admin?tab=${views[newValue]}`);
setModalUser({});
};
}
if (firstRequest) {
setFirstRequest(false);
+3 -1
View File
@@ -776,7 +776,9 @@ const UsecaseListComponent = ({keys, isCloud, globalUrl, frameworkData, isLogged
var baseTypeInfo = subcase.type !== undefined ? subcase.type : "communication"
if (frameworkData !== undefined && frameworkData !== null) {
if (frameworkData[baseTypeInfo] !== undefined && frameworkData[baseTypeInfo] !== null && subdata.app !== undefined && subdata.app !== null) {
if (frameworkData[baseTypeInfo].name.toLowerCase().replaceAll("_", " ") === subdata.app.toLowerCase().replaceAll("_", " ")) {
console.log("Name: ", frameworkData[baseTypeInfo], baseTypeInfo)
console.log("Name2: ", subdata.app)
if (frameworkData[baseTypeInfo].name !== undefined && frameworkData[baseTypeInfo].name.toLowerCase().replaceAll("_", " ") === subdata.app.toLowerCase().replaceAll("_", " ")) {
highlight = true
}
}
+1 -1
View File
@@ -164,7 +164,7 @@ const Search = (props) => {
<DocsGrid maxRows={6} parsedXs={12} showSuggestion={true} globalUrl={globalUrl} isMobile={isMobile} userdata={userdata} />
:
curTab === 3 ?
<CreatorGrid maxRows={3} parsedXs={4} showSuggestion={true} globalUrl={globalUrl} isMobile={isMobile} userdata={userdata} />
<CreatorGrid parsedXs={4} showSuggestion={true} globalUrl={globalUrl} isMobile={isMobile} userdata={userdata} />
:
null}
</div>
+1 -3
View File
@@ -2949,9 +2949,7 @@ const Workflows = (props) => {
const WorkflowView = () => {
if (workflows.length === 0) {
console.log("USER: ", userdata)
console.log("PROPS: ", props)
if (userdata.tutorials !== undefined && userdata.tutorials !== null && !userdata.tutorials.includes("getting-started")) {
if ((userdata.tutorials !== undefined && userdata.tutorials !== null && !userdata.tutorials.includes("getting-started")) || userdata.tutorials === null) {
return <Navigate to="/getting-started" replace />;
}