From f655b8f1aa71f2e3b1cdfd1570e84312fb6891fe Mon Sep 17 00:00:00 2001 From: booploops <49113086+booploops@users.noreply.github.com> Date: Mon, 14 Feb 2022 00:36:48 -0800 Subject: [PATCH] checking if theme is already installed --- src/main/base/browserwindow.ts | 4 ++-- src/renderer/views/pages/themes-github.ejs | 19 +++++++++++++++++-- 2 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/main/base/browserwindow.ts b/src/main/base/browserwindow.ts index 98125067..0cd560ee 100644 --- a/src/main/base/browserwindow.ts +++ b/src/main/base/browserwindow.ts @@ -431,7 +431,7 @@ export class BrowserWindow { description: themeJson.description || themeDescription, path: themePath, file: theme, - test: join(themePath, "theme.json") + github_repo: themeJson.github_repo || "" }); } else { themeObjects.push({ @@ -439,7 +439,7 @@ export class BrowserWindow { description: themeDescription, path: themePath, file: theme, - test: join(themePath, "theme.json") + github_repo: "" }); } } diff --git a/src/renderer/views/pages/themes-github.ejs b/src/renderer/views/pages/themes-github.ejs index 98d4ee11..78c21b74 100644 --- a/src/renderer/views/pages/themes-github.ejs +++ b/src/renderer/views/pages/themes-github.ejs @@ -39,7 +39,10 @@
- +
@@ -67,13 +70,25 @@ avatar_url: '' }, readme: "" - } + }, + themesInstalled: [] } }, mounted() { this.getRepos(); + this.getInstalledThemes(); }, methods: { + getInstalledThemes() { + let self = this + const themes = ipcRenderer.sendSync("get-themes") + // for each theme, get the github_repo property and push it to the themesInstalled array, if not blank + themes.forEach(theme => { + if (theme.github_repo !== "") { + self.themesInstalled.push(theme.github_repo) + } + }) + }, showRepo(repo) { const self = this const readmeUrl = `https://raw.githubusercontent.com/${repo.full_name}/main/README.md`;