Buttons on right : hotlaod and download from github

This commit is contained in:
monilprajapati
2024-12-02 12:29:40 +05:30
parent 675707cb49
commit e269bf0894
+10 -6
View File
@@ -1037,9 +1037,11 @@ const Apps2 = (props) => {
if (storageApps === null || storageApps === undefined || storageApps.length === 0) { if (storageApps === null || storageApps === undefined || storageApps.length === 0) {
storageApps = [] storageApps = []
} else { } else {
setAppsToShow(storageApps)
setOrgApps(storageApps)
setApps(storageApps) setApps(storageApps)
setFilteredApps(storageApps) // setFilteredApps(storageApps)
setAppSearchLoading(false) // setAppSearchLoading(false)
} }
} catch (e) { } catch (e) {
//console.log("Failed to get apps from localstorage: ", e) //console.log("Failed to get apps from localstorage: ", e)
@@ -1095,12 +1097,14 @@ const Apps2 = (props) => {
privateapps.push(...valid); privateapps.push(...valid);
privateapps.push(...invalid); privateapps.push(...invalid);
console.log("privateapps: setting apps ", privateapps) console.log("privateapps: setting apps ", privateapps)
setAppsToShow(privateapps);
setOrgApps(privateapps);
setApps(privateapps); setApps(privateapps);
// setCursearch(""); // setCursearch("");
//handleSearchChange(event.target.value) //handleSearchChange(event.target.value)
//setCursearch(event.target.value) //setCursearch(event.target.value)
setFilteredApps(privateapps); // setFilteredApps(privateapps);
if (privateapps.length > 0) { if (privateapps.length > 0) {
if (selectedApp.id === undefined || selectedApp.id === null) { if (selectedApp.id === undefined || selectedApp.id === null) {
if (privateapps[0].owner !== undefined && privateapps[0].owner !== null) { if (privateapps[0].owner !== undefined && privateapps[0].owner !== null) {
@@ -1141,7 +1145,6 @@ const Apps2 = (props) => {
}); });
}; };
// Locally hotloads app from folder // Locally hotloads app from folder
const hotloadApps = () => { const hotloadApps = () => {
toast("Hotloading apps from location in .env"); toast("Hotloading apps from location in .env");
@@ -1167,12 +1170,13 @@ const Apps2 = (props) => {
if (responseJson.success === true) { if (responseJson.success === true) {
toast("Successfully finished hotload"); toast("Successfully finished hotload");
} else { } else {
toast("Failed hotload: ", responseJson.reason); console.log("failed hotload: ", responseJson)
// toast(`Failed hotload: ${responseJson.reason}`);
//(responseJson.reason !== undefined && responseJson.reason.length > 0) { //(responseJson.reason !== undefined && responseJson.reason.length > 0) {
} }
}) })
.catch((error) => { .catch((error) => {
toast(error.toString()); toast(`Failed hotload: ${error.toString()}`);
}); });
}; };