#107: Fixed double apps and general duplicates

This commit is contained in:
frikky
2020-07-23 15:28:26 +02:00
parent 8db710a562
commit 10ac88d30b
2 changed files with 36 additions and 16 deletions
+12 -5
View File
@@ -743,7 +743,7 @@ const Apps = (props) => {
null
// Load data e.g. from github
const getSpecificApps = (url) => {
const getSpecificApps = (url, forceUpdate) => {
setValidation(true)
setIsLoading(true)
@@ -761,6 +761,8 @@ const Apps = (props) => {
parsedData["field_2"] = field2
}
parsedData["force_update"] = forceUpdate
alert.success("Getting specific apps from your URL.")
var cors = "cors"
fetch(globalUrl+"/api/v1/apps/get_existing", {
@@ -977,8 +979,8 @@ const Apps = (props) => {
window.location.href = "/apps/new?id="+appValidation
}
const handleGithubValidation = () => {
getSpecificApps(openApi)
const handleGithubValidation = (forceUpdate) => {
getSpecificApps(openApi, forceUpdate)
setLoadAppsModalOpen(false)
}
@@ -1034,7 +1036,7 @@ const Apps = (props) => {
>
<DialogTitle>
<div style={{color: "rgba(255,255,255,0.9)"}}>
Load from github repo
Load from github repo
</div>
</DialogTitle>
<DialogContent style={{color: "rgba(255,255,255,0.65)"}}>
@@ -1098,7 +1100,12 @@ const Apps = (props) => {
Cancel
</Button>
<Button style={{borderRadius: "0px"}} disabled={openApi.length === 0 || !openApi.includes("http")} onClick={() => {
handleGithubValidation()
handleGithubValidation(true)
}} color="primary">
Force update
</Button>
<Button variant="outlined" style={{float: "left", borderRadius: "0px"}} disabled={openApi.length === 0 || !openApi.includes("http")} onClick={() => {
handleGithubValidation(false)
}} color="primary">
Submit
</Button>