Fixed frontend vulnerabilities

This commit is contained in:
frikky
2021-02-03 03:03:50 +01:00
parent 7c0b0c8c2b
commit 11ddf604ec
5 changed files with 12 additions and 6 deletions
+5
View File
@@ -168,6 +168,10 @@ const Apps = (props) => {
})
function sortByKey(array, key) {
if (array === undefined || array === null) {
return []
}
return array.sort(function(a, b) {
var x = a[key];
var y = b[key];
@@ -222,6 +226,7 @@ const Apps = (props) => {
return response.json()
})
.then((responseJson) => {
console.log("Apps: ", responseJson)
responseJson = sortByKey(responseJson, "large_image")
setApps(responseJson)