Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
- gui: Show a loading spinner and prevent repeated clicks while a TonieCard background download is in progress
- gui: Fixed TAF track downloads in the TonieInformationModal to use the correct linked/source TAF for Content and Tonies views, including uncached Tonies, and keep track selections across re-renders, screen size changes and audio player updates
- gui: TeddyStudio: Reworked label printing to generate a browser-independent PDF instead of relying on CSS print layouts, including PDF preview and download functionality [https://github.com/toniebox-reverse-engineering/teddycloud_web/issues/286](https://github.com/toniebox-reverse-engineering/teddycloud_web/issues/286)
- gui: adapted outdated hint to new release candidate tags
- gui: Adapted outdated hint to new release candidate tags

### Commits

Expand Down
4 changes: 3 additions & 1 deletion src/components/common/footer/StyledFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,9 @@ export const StyledFooter = () => {
<Link
to={
isReleaseCandidateVersion
? gitHubTCCommitTreeBaseUrl + latestReleaseCandidateTag
? gitHubTCCommitTreeBaseUrl +
"rc_" +
versionShort.replace("-rc", "-")
: isDevelopVersion
? gitHubTCCommitTreeBaseUrl + commitGitSha
: gitHubTCReleasesUrl + "tag/tc_" + versionShort
Expand Down
2 changes: 1 addition & 1 deletion src/components/home/features/Features.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const Features = () => {
<Link
to={
isReleaseCandidateVersion
? gitHubTCCommitTreeBaseUrl + latestReleaseCandidateTag
? gitHubTCCommitTreeBaseUrl + "rc_" + versionShort.replace("-rc", "-")
: isDevelopVersion
? gitHubTCCommitTreeBaseUrl + commitGitSha
: gitHubTCReleasesUrl + "tag/tc_" + versionShort
Expand Down
35 changes: 29 additions & 6 deletions src/hooks/useTeddyCloudVersion.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,39 @@ export const useTeddyCloudVersion = () => {
return 0;
});

const latestSHA = candidates[0]?.object.sha;
const latest = candidates[0];

if (!latestSHA) {
if (!latest) {
return;
}

setLatestReleaseCandidateTag(candidates[0].ref.replace("refs/tags/", ""));
setNewVersionAvailable(
!commitGitSha.includes("unknown") && commitGitSha !== latestSHA,
);
const latestTag = latest.ref.replace("refs/tags/", "");

// Example: v0.7.1-rc2 -> rc_v0.7.1-2
const currentTag = versionShort
.replace(/^v/, "rc_v")
.replace(/-rc(\d+)$/, "-$1")
.replace(/-rc$/, "");

const currentVersion = parseRcVersion(`refs/tags/${currentTag}`);

setLatestReleaseCandidateTag(latestTag);

if (!currentVersion) {
return;
}

const updateAvailable = latest.version!.some((value, index) => {
for (let i = 0; i < index; i++) {
if (latest.version![i] !== currentVersion[i]) {
return false;
}
}

return value > currentVersion[index];
});

setNewVersionAvailable(updateAvailable);
} else if (develop) {
const latestDevelopSHA = versionInfo.sha;
setNewVersionAvailable(
Expand Down
Loading