Skip to content

Commit

Permalink
in-app updater, fixes auto-update issues
Browse files Browse the repository at this point in the history
  • Loading branch information
artifishvr committed Jul 17, 2024
1 parent 9b7c337 commit fa2eabb
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tbh"
version = "2.2.5"
version = "2.2.6"
description = "tbh for your desktop"
authors = ["artifishvr"]
edition = "2021"
Expand Down
4 changes: 2 additions & 2 deletions src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"package": {
"productName": "tbh",
"version": "2.2.5"
"version": "2.2.6"
},
"tauri": {
"allowlist": {
Expand Down Expand Up @@ -51,7 +51,7 @@
"endpoints": [
"https://github.com/artifishvr/tbhdesktop/releases/latest/download/latest.json"
],
"dialog": true,
"dialog": false,
"pubkey": "dW50cnVzdGVkIGNvbW1lbnQ6IG1pbmlzaWduIHB1YmxpYyBrZXk6IEZDRUFBRjkwN0RDMTMxQ0IKUldUTE1jRjlrSy9xL0JYaUZqbnFOKzhSNGZZR3RKRmJMbnMyZ0Z5NnpNOTk5dThZUmNZVFRwVmUK"
}
}
Expand Down
22 changes: 21 additions & 1 deletion src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,29 @@ <h1>Settings</h1>
</video>

<img src="tbh.png" id="tbh" alt="tbh">

<a id="updatebanner" href="https://github.com/artifishvr/tbhdesktop/releases" target="_blank" style="display: none;">
<div class="banner">
<p id="updatetext">Update Available!<br>Click here to download!</p>
</div>
</a>
</body>

</html>

<script src="tbh.js" type="module"></script>
<script src="settingsmodal.js" type="module"></script>
<script src="settingsmodal.js" type="module"></script>
<script type="module">
import { checkUpdate } from '@tauri-apps/api/updater';

update();

async function update() {
const update = await checkUpdate();

if (update.shouldUpdate) {
document.getElementById("updatebanner").style.display = "block";
document.getElementById("updatetext").innerText = `Update Available (v${update.manifest.version})\nClick to download!`
}
}
</script>
14 changes: 14 additions & 0 deletions src/tbh.css
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,17 @@ body {
text-decoration: none;
cursor: pointer;
}

.banner {
font-family: Arial, Helvetica, sans-serif;
position: fixed;
left: 0;
bottom: 0;
width: 100%;
background-color: #16a34a;
color: white;
text-align: center;
z-index: 1;
font-size: 1.6rem;
line-height: 1.5;
}

0 comments on commit fa2eabb

Please sign in to comment.