diff --git a/index.html b/index.html index d247b02..95f0af0 100644 --- a/index.html +++ b/index.html @@ -29,6 +29,15 @@ currentPath: '', isLoading: false, + init() { + this.$watch('currentPath', () => this.refreshIcons()); + this.$watch('fileTree', () => this.refreshIcons()); + }, + + refreshIcons() { + this.$nextTick(() => lucide.createIcons()); + }, + async selectRepo(repoStr) { this.currentRepo = repoStr; this.currentPath = ''; @@ -48,11 +57,11 @@ const data = await response.json(); this.fileTree = data.tree || []; } catch (e) { - alert('Error fetching repository, Meowster. Check your PAT or repo name.'); + alert('Error fetching repository, Meowster.'); this.currentRepo = null; } finally { this.isLoading = false; - this.$nextTick(() => lucide.createIcons()); + this.refreshIcons(); } }, @@ -73,14 +82,16 @@ return this.currentPath.split('/'); }, + get repoDisplayName() { + if (!this.currentRepo) return ''; + return this.currentRepo.split('@')[0].split('/').pop(); + }, + navigateTo(path) { const item = this.fileTree.find(i => i.path === path); if (item && item.type === 'tree') { this.currentPath = path; - } else if (item && item.type === 'blob') { - alert('Opening file: ' + path + ', Master.'); } - this.$nextTick(() => lucide.createIcons()); }, goUp() { @@ -88,7 +99,6 @@ const parts = this.currentPath.split('/'); parts.pop(); this.currentPath = parts.join('/'); - this.$nextTick(() => lucide.createIcons()); }, addRepo() { @@ -96,9 +106,7 @@ if (repo && repo.includes('/')) { this.repos.push(repo); this.saveRepos(); - this.$nextTick(() => lucide.createIcons()); - } else if (repo) { - alert('Invalid format, Meowster.'); + this.refreshIcons(); } }, @@ -114,18 +122,9 @@
-
- -
- -
+
@@ -145,7 +144,7 @@
- +