Skip to content

Commit

Permalink
Fix display version (#172)
Browse files Browse the repository at this point in the history
  • Loading branch information
Crauzer authored Apr 11, 2023
1 parent 34d9ee1 commit ec21bd9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions Obsidian/Shared/MainLayout.razor
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
@using System.Reflection;
@using Semver;
@using Serilog;
@using System.Diagnostics;
@inherits LayoutComponentBase

<style>
Expand Down Expand Up @@ -68,7 +69,7 @@
OnClick="GoToGithub" />
</MudTooltip>
<MudText Typo="Typo.body2">
@Version
@DisplayVersion
</MudText>
</MudStack>
</MudStack>
Expand Down Expand Up @@ -97,7 +98,7 @@

public string UpdateUrl { get; set; }

public string Version => SemVersion.FromVersion(Assembly.GetExecutingAssembly().GetName().Version).ToString();
public string DisplayVersion => SemVersion.FromVersion(Version.Parse(FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location).FileVersion)).ToString();

private bool _isLoadingHashtable;
private bool _isReady;
Expand Down Expand Up @@ -146,9 +147,8 @@
IReadOnlyList<Release> releases = await gitClient.Repository.Release.GetAll("Crauzer", "Obsidian");
Release newestRelease = releases[0];

Version assemblyVersion = Assembly.GetExecutingAssembly().GetName().Version;

SemVersion assemblySemver = SemVersion.FromVersion(assemblyVersion);
FileVersionInfo versionInfo = FileVersionInfo.GetVersionInfo(Assembly.GetExecutingAssembly().Location);
SemVersion assemblySemver = SemVersion.FromVersion(Version.Parse(versionInfo.FileVersion));
SemVersion latestReleaseSemver = SemVersion.Parse(newestRelease.TagName, SemVersionStyles.Strict);

if (latestReleaseSemver.IsPrerelease is false
Expand Down

0 comments on commit ec21bd9

Please sign in to comment.