Skip to content

Commit

Permalink
Fix banner bug
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelGoerentz committed Aug 16, 2024
1 parent fdedf45 commit e0200f4
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 39 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@ jobs:
tags: |
mgoerentz/threadfin:latest
mgoerentz/threadfin:${{ github.ref_name }}
ghcr.io/marcelGoerentz/threadfin:latest
ghcr.io/marcelGoerentz/threadfin:${{ github.ref_name }}
ghcr.io/marcelgoerentz/threadfin:latest
ghcr.io/marcelgoerentz/threadfin:${{ github.ref_name }}
1 change: 0 additions & 1 deletion html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
<body onload="javascript: PageReady();">

<div class="banner">
New Version available! Click <a href="https://github.com/marcelGoerentz/Threadfin/releases/latest">here</a> to download.
</div>

<div id="loading" class="modal fade">
Expand Down
52 changes: 26 additions & 26 deletions src/webUI.go

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions threadfin.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,13 @@ var GitHub = GitHubStruct{Branch: "Main", User: "marcelGoerentz", Repo: "Threadf
const Name = "Threadfin"

// Version : Version, die Build Nummer wird in der main func geparst.
const Version = "1.3.2-beta"
const Version = "1.3.1-beta"

// DBVersion : Datanbank Version
const DBVersion = "0.5.0"

// APIVersion : API Version
const APIVersion = "1.3.2-beta"
const APIVersion = "1.3.1-beta"

var homeDirectory = fmt.Sprintf("%s%s.%s%s", src.GetUserHomeDirectory(), string(os.PathSeparator), strings.ToLower(Name), string(os.PathSeparator))
var samplePath = fmt.Sprintf("%spath%sto%sthreadfin%s", string(os.PathSeparator), string(os.PathSeparator), string(os.PathSeparator), string(os.PathSeparator))
Expand Down
18 changes: 10 additions & 8 deletions ts/banner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,21 @@ async function getNewestReleaseFromGithub() {
const release_version = [release_major_version, release_minor_version, release_build_version]
let current_version = []

if (SERVER) {
if ('clientInfo' in SERVER) {
var current_version_string = SERVER["clientInfo"]["version"];
current_version.push(current_version_string.split(".")[0]);
current_version.push(current_version_string.split(".")[1][0]);
current_version.push(current_version_string.split("(")[1][0]);
}
for (let i = 0; i < 3; i++) {
if (release_version[i] > current_version[i]) {
bannerElement.innerHTML = 'New Version available! Click <a href="https://github.com/marcelGoerentz/Threadfin/releases/latest">here</a> to download.';
bannerElement.style.display = 'block'; // Show Banner if newer version is available
break
} else if (release_version[i] < current_version[i]) {
break
if (current_version.length !== 0) {
for (let i = 0; i < 3; i++) {
if (release_version[i] > current_version[i]) {
bannerElement.innerHTML = 'New Version available! Click <a href="https://github.com/marcelGoerentz/Threadfin/releases/latest">here</a> to download.';
bannerElement.style.display = 'block'; // Show Banner if newer version is available
break
} else if (release_version[i] < current_version[i]) {
break
}
}
}
} else {
Expand Down

0 comments on commit e0200f4

Please sign in to comment.