verify commit field exists

This commit is contained in:
booploops 2022-02-28 22:06:46 -08:00
parent fa48b2fdbc
commit f46826d696
2 changed files with 5 additions and 7 deletions

View file

@ -657,7 +657,8 @@ export class BrowserWindow {
description: themeJson.description || themeDescription, description: themeJson.description || themeDescription,
path: themePath, path: themePath,
file: theme, file: theme,
github_repo: themeJson.github_repo || "" github_repo: themeJson.github_repo || "",
commit: themeJson.commit || ""
}); });
} else { } else {
themeObjects.push({ themeObjects.push({
@ -665,7 +666,8 @@ export class BrowserWindow {
description: themeDescription, description: themeDescription,
path: themePath, path: themePath,
file: theme, file: theme,
github_repo: "" github_repo: "",
commit: ""
}); });
} }
} }

View file

@ -104,8 +104,7 @@
const themes = ipcRenderer.sendSync("get-themes") const themes = ipcRenderer.sendSync("get-themes")
// for each theme, get the github_repo property and push it to the themesInstalled array, if not blank // for each theme, get the github_repo property and push it to the themesInstalled array, if not blank
themes.forEach(theme => { themes.forEach(theme => {
if (theme.github_repo !== "") { if (theme.github_repo !== "" && typeof theme.commit != "") {
theme.github_repo = theme.github_repo.toLowerCase()
self.themesInstalled.push(theme.github_repo) self.themesInstalled.push(theme.github_repo)
} }
}) })
@ -182,9 +181,6 @@
.then(response => response.text()) .then(response => response.text())
.then(result => { .then(result => {
let items = JSON.parse(result).items let items = JSON.parse(result).items
items.forEach(repo => {
repo.full_name = repo.full_name.toLowerCase()
})
self.repos = items self.repos = items
}) })
.catch(error => console.log('error', error)); .catch(error => console.log('error', error));