File tree Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 1
1
using System . Collections . Generic ;
2
+ using System . Reflection ;
2
3
3
4
using Avalonia . Input . Platform ;
4
5
@@ -40,6 +41,11 @@ public static class Constants {
40
41
/// </summary>
41
42
public const string TWITCH_CLIENT_REDIRECT = $ "{ API_SITE_DOMAIN } /api/v1/user/twitch-login/twitch-streaming-tools";
42
43
44
+ /// <summary>
45
+ /// The version of the application being run right now.
46
+ /// </summary>
47
+ public static readonly string ? APP_VERSION = Assembly . GetEntryAssembly ( ) ? . GetName ( ) . Version ? . ToString ( ) [ ..^ 2 ] ;
48
+
43
49
/// <summary>
44
50
/// The reference to the clipboard API.
45
51
/// </summary>
Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ public string? TwitchUsername {
83
83
/// <summary>
84
84
/// The application version number.
85
85
/// </summary>
86
- public string ? Version => Assembly . GetEntryAssembly ( ) ? . GetName ( ) . Version ? . ToString ( ) ;
86
+ public string ? Version => Constants . APP_VERSION ;
87
87
88
88
/// <inheritdoc />
89
89
public void Dispose ( ) {
Original file line number Diff line number Diff line change @@ -57,7 +57,7 @@ protected override void OnInitialized() {
57
57
Task . Factory . StartNew ( async ( ) => {
58
58
GithubLatestReleaseJson ? serverVersion =
59
59
await GitHubUpdateManager . GetLatestVersion ( "nullinside-development-group" , "twitch-streaming-tools" ) ;
60
- string ? localVersion = Assembly . GetEntryAssembly ( ) ? . GetName ( ) . Version ? . ToString ( ) ;
60
+ string ? localVersion = Constants . APP_VERSION ;
61
61
if ( null == serverVersion || string . IsNullOrWhiteSpace ( serverVersion . name ) ||
62
62
string . IsNullOrWhiteSpace ( localVersion ) ) {
63
63
return ;
You can’t perform that action at this time.
0 commit comments