Skip to content

Commit

Permalink
fix update check
Browse files Browse the repository at this point in the history
  • Loading branch information
Frontesque committed Feb 25, 2025
1 parent 949d38e commit bcf486e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
25 changes: 16 additions & 9 deletions application/components/update_check.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,26 @@ export default {
repo: []
}
},
methods: {
async get_latest_release(env) {
this.repo = await $fetch(env.releases_url);
for (const i in this.repo) {
if (this.repo[i].prerelease === false) {
return this.repo[i];
}
}
},
open() {
require('electron').shell.openExternal(this.repo[0].html_url)
}
},
async mounted() {
if (localStorage.getItem("setting.disable_update_check") == "true") return;
const environment = await invoke("environment");
this.currentVersion = environment.app_version;
this.repo = await $fetch(environment.releases_url);
this.latestVersion = this.repo[0].name;
const release = await this.get_latest_release(environment);
this.latestVersion = release.tag_name;
const latest = this.latestVersion.split(".");
const current = this.currentVersion.split(".");
for (const i in latest) {
Expand All @@ -45,12 +58,6 @@ export default {
return this.updateAvailable = true;
}
}
},
methods: {
open() {
require('electron').shell.openExternal(this.repo[0].html_url)
}
}
}
</script>
2 changes: 1 addition & 1 deletion application/src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ rust-version = "1.82"

[lib]
name = "scrcpyplus_lib"
crate-type = ["staticlib", "cdylib", "rlib", "lib"]
crate-type = ["staticlib", "cdylib", "rlib"]

[build-dependencies]
tauri-build = { version = "2.0.0-rc.0", features = [] }
Expand Down

0 comments on commit bcf486e

Please sign in to comment.