11<script lang="ts" setup>
22import { onMounted , provide , ref } from ' vue'
3- import { OpenRepository , SelectDirectory , Version } from ' ../wailsjs/go/main/App'
3+ import { CheckForUpdate , OpenRepository , SelectDirectory , Version } from ' ../wailsjs/go/main/App'
44import RepoSelector from ' ./components/RepoSelector.vue'
55import RecentReposList from ' ./components/RecentReposList.vue'
66
@@ -10,9 +10,20 @@ const loading = ref(false)
1010const error = ref (' ' )
1111const repoReady = ref (false )
1212const appVersion = ref (' ' )
13+ const updateURL = ref (' ' )
14+ const updateTag = ref (' ' )
1315
1416onMounted (async () => {
1517 appVersion .value = await Version ()
18+ try {
19+ const info = await CheckForUpdate ()
20+ if (info .available ) {
21+ updateTag .value = info .tag
22+ updateURL .value = info .url
23+ }
24+ } catch {
25+ // Silently ignore update check failures
26+ }
1627})
1728
1829async function onSelectRepo() {
@@ -83,7 +94,11 @@ async function onOpenRecent(path: string) {
8394 </main >
8495 <footer v-if =" appVersion" >
8596 <a href =" https://github.com/tbrittain/git-analytics" target =" _blank" rel =" noopener" >Git Analytics</a >
97+ <span class =" separator" >·</span >
8698 <span >{{ appVersion }}</span >
99+ <a v-if =" updateURL" :href =" updateURL" target =" _blank" rel =" noopener" class =" update-link" >
100+ Update available: {{ updateTag }}
101+ </a >
87102 </footer >
88103 </div >
89104</template >
@@ -151,8 +166,8 @@ main {
151166
152167footer {
153168 display : flex ;
154- justify-content : space-between ;
155169 align-items : center ;
170+ gap : 8px ;
156171 padding : 8px 20px ;
157172 border-top : 1px solid #30363d ;
158173 color : #8b949e ;
@@ -170,6 +185,19 @@ footer a:hover {
170185 text-decoration : underline ;
171186}
172187
188+ .separator {
189+ color : #30363d ;
190+ }
191+
192+ .update-link {
193+ margin-left : auto ;
194+ color : #58a6ff ;
195+ }
196+
197+ .update-link :hover {
198+ color : #79c0ff ;
199+ }
200+
173201.status {
174202 display : flex ;
175203 align-items : center ;
0 commit comments