Skip to content

Commit

Permalink
Update changelog url
Browse files Browse the repository at this point in the history
  • Loading branch information
rocksdanister committed May 1, 2024
1 parent 545b172 commit 0a907dd
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/Lively/Lively.UI.WinUI/ViewModels/AppUpdateViewModel.cs
Expand Up @@ -60,14 +60,16 @@ public partial class AppUpdateViewModel : ObservableObject

public bool IsWinStore => Constants.ApplicationType.IsMSIX;

public bool IsBetaBuild => Constants.ApplicationType.IsTestBuild;

public string AppVersionText
{
get
{
var ver = "v" + desktopCore.AssemblyVersion;
if (Constants.ApplicationType.IsTestBuild)
if (IsBetaBuild)
ver += "b";
else if (Constants.ApplicationType.IsMSIX)
else if (IsWinStore)
ver += $" {languageResource.GetString("Store/Header")}";
return ver;
}
Expand Down
1 change: 0 additions & 1 deletion src/Lively/Lively.UI.WinUI/Views/Pages/AppUpdateView.xaml
Expand Up @@ -25,7 +25,6 @@
CoreWebView2Initialized="WebView_CoreWebView2Initialized"
DefaultBackgroundColor="Black"
NavigationStarting="WebView_NavigationStarting"
Source="https://www.rocksdanister.com/lively/changelog/?source=app"
Visibility="{Binding UpdateChangelogError, Mode=OneWay, Converter={StaticResource NullVisibilityConverter}, ConverterParameter=Reverse}" />
<!-- Changelog error -->
<StackPanel
Expand Down
13 changes: 13 additions & 0 deletions src/Lively/Lively.UI.WinUI/Views/Pages/AppUpdateView.xaml.cs
@@ -1,4 +1,5 @@
using Lively.Common;
using Lively.Grpc.Client;
using Lively.UI.WinUI.ViewModels;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.UI.Xaml;
Expand All @@ -20,6 +21,18 @@ public AppUpdateView()
this.InitializeComponent();
this.viewModel = App.Services.GetRequiredService<AppUpdateViewModel>();
this.DataContext = this.viewModel;

var pageTheme = App.Services.GetRequiredService<IUserSettingsClient>().Settings.ApplicationTheme switch
{
AppTheme.Auto => string.Empty, // Website handles theme change based on WebView change.
AppTheme.Light => "&theme=light",
AppTheme.Dark => "&theme=dark",
_ => string.Empty,
};
var url = !viewModel.IsBetaBuild ?
$"https://www.rocksdanister.com/lively/changelog/?source=app{pageTheme}" :
$"https://www.rocksdanister.com/lively-webpage/changelog/?source=app{pageTheme}";
WebView.Source = LinkUtil.SanitizeUrl(url);
}

// ref: https://github.com/MicrosoftEdge/WebView2Samples
Expand Down

0 comments on commit 0a907dd

Please sign in to comment.