Skip to content

Commit

Permalink
🐛 Fix check-for-update false positive (#333)
Browse files Browse the repository at this point in the history
* 🐛 Fix `check-for-update` false positive

Fixes #320

* 🐛 Fix shrinking sidebar buttons

Just added `shrink-0` to ensure the buttons don't shrink on certain viewports
  • Loading branch information
aaronleopold committed May 1, 2024
1 parent bf82e01 commit 316cd09
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion apps/server/src/routers/api/v1/mod.rs
Expand Up @@ -137,11 +137,15 @@ async fn check_for_updates() -> APIResult<Json<UpdateCheck>> {
if github_response.status().is_success() {
let github_json: serde_json::Value = github_response.json().await?;

let latest_semver = github_json["tag_name"].as_str().ok_or_else(|| {
let mut latest_semver = github_json["tag_name"].as_str().ok_or_else(|| {
APIError::InternalServerError(
"Failed to parse latest release tag name".to_string(),
)
})?;
if latest_semver.starts_with('v') && latest_semver.len() > 1 {
latest_semver = &latest_semver[1..];
}

let has_update_available = latest_semver != current_semver;

Ok(Json(UpdateCheck {
Expand Down
Expand Up @@ -23,7 +23,7 @@ export default function SideBarButtonLink({
return (
<div
className={cn(
'group inline-flex h-[2.35rem] w-full items-center justify-start rounded-md px-2 text-sm transition-all duration-150 hover:bg-sidebar-300',
'group inline-flex h-[2.35rem] w-full shrink-0 items-center justify-start rounded-md px-2 text-sm transition-all duration-150 hover:bg-sidebar-300',
{
'justify-center border border-dashed border-sidebar-300 bg-opacity-50 text-contrast-200 text-opacity-80 hover:bg-sidebar-200 hover:text-opacity-100':
variant === 'action',
Expand Down

0 comments on commit 316cd09

Please sign in to comment.