Skip to content

Commit e82f5b5

Browse files
authored
disable update button/icon if no update avail (#700)
* FIX: hide update button/icon if no update avail * FIX: disable stereum update button/icon if no update avail
1 parent cf67b43 commit e82f5b5

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

launcher/src/components/UI/node-header/MainNavbar.vue

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ export default {
209209
name: "Stereum",
210210
version: response.stereum[response.stereum.length - 1].name,
211211
current: currentVersion ? currentVersion.name : "-",
212+
current_commit: currentVersion ? currentVersion.commit : "-",
212213
};
213214
214215
console.log("Stereum Update Available!");

launcher/src/components/UI/node-header/UpdatePanel.vue

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,15 @@
3535
<div class="searchBtn">
3636
<img src="/img/icon/header-icons/search.png" alt="icon" />
3737
</div>
38-
<div class="downloadBtn" @click="$emit('runUpdate', stereumUpdate)">
38+
<div class="downloadBtn" :class="{disabled:checkStereumUpdate}" @click="$emit('runUpdate', stereumUpdate)">
3939
<img
4040
src="/img/icon/node-journal-icons/download2.png"
4141
alt="icon"
4242
/>
4343
</div>
4444

4545
<div v-if="checkStereumUpdate()" class="available">
46+
4647
<div class="updateIcon">
4748
<img src="/img/icon/header-icons/update-green.png" alt="icon" />
4849
</div>
@@ -145,7 +146,9 @@ export default {
145146
methods: {
146147
checkStereumUpdate() {
147148
if (this.stereumUpdate && this.stereumUpdate.version) {
148-
return true;
149+
// console.log(this.stereumUpdate.commit) // commit hash of the newest newest release tag
150+
// console.log(this.stereumUpdate.current_commit) // current installed commit on the os
151+
return this.stereumUpdate.commit != this.stereumUpdate.current_commit ? true : false;
149152
}
150153
return false;
151154
},
@@ -683,4 +686,10 @@ export default {
683686
text-transform: uppercase;
684687
margin-right: 5px;
685688
}
689+
690+
.disabled{
691+
pointer-events: none;
692+
background-color: #074634 !important;
693+
opacity: 0.5;
694+
}
686695
</style>

0 commit comments

Comments
 (0)