Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ysmoradi committed Dec 26, 2024
1 parent fb95ec7 commit 2fe8980
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -111,13 +111,16 @@ private async Task CheckForUpdates()
{
if (await AppStoreInfo.Current.IsUsingLatestVersionAsync() is false)
{
if (await storageService.GetItem($"{AppInfo.Version}_UpdateFromVersionIsRequested") is not "true")
var newVersion = AppStoreInfo.Current.GetLatestVersionAsync();
var releaseNotes = (await AppStoreInfo.Current.GetInformationAsync()).ReleaseNotes;

if (await storageService.GetItem($"{newVersion}_UpdateFromVersionIsRequested") is not "true")
{
await storageService.SetItem($"{AppInfo.Version}_UpdateFromVersionIsRequested", "true");
await storageService.SetItem($"{newVersion}_UpdateFromVersionIsRequested", "true");

// It's an opportune moment to request an update. (:
// https://github.com/oscoreio/Maui.AppStoreInfo
if (await App.Current!.Windows[0].Page!.DisplayAlert(AppStrings.NewVersionIsAvailable, AppStrings.UpdateToNewVersion, AppStrings.Yes, AppStrings.No) is true)
if (await App.Current!.Windows[0].Page!.DisplayAlert(localizer[nameof(AppStrings.NewVersionIsAvailable)], localizer[nameof(AppStrings.UpdateToNewVersion), releaseNotes], localizer[nameof(AppStrings.Yes)], localizer[nameof(AppStrings.No)]) is true)
{
await AppStoreInfo.Current.OpenApplicationInStoreAsync();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ protected async override Task OnInitAsync()
appVersion = telemetryContext.AppVersion!;
processId = Environment.ProcessId.ToString();
//#if (framework == 'net9.0')
appVersion += $" Latest: {await AppStoreInfo.Current.GetLatestVersionAsync(CurrentCancellationToken)}";
appVersion += $" / {await AppStoreInfo.Current.GetLatestVersionAsync(CurrentCancellationToken)}";
//#endif

await base.OnInitAsync();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,7 @@
<value>نسخه جدید در دسترس است</value>
</data>
<data name="UpdateToNewVersion" xml:space="preserve">
<value>آیا می خواهید به نسخه جدید بروید؟</value>
<value>آیا می خواهید به نسخه جدید بروید؟ {0}</value>
</data>
<data name="AboutTitle" xml:space="preserve">
<value>درباره</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,7 @@
<value>Nieuwe versie is beschikbaar</value>
</data>
<data name="UpdateToNewVersion" xml:space="preserve">
<value>Wilt u updaten naar de nieuwe versie?</value>
<value>Wilt u updaten naar de nieuwe versie? {0}</value>
</data>
<data name="AboutTitle" xml:space="preserve">
<value>Over</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1015,7 +1015,7 @@
<value>New version is available</value>
</data>
<data name="UpdateToNewVersion" xml:space="preserve">
<value>Would you like to update to the new version?</value>
<value>Would you like to update to the new version? {0}</value>
</data>
<data name="AboutTitle" xml:space="preserve">
<value>About</value>
Expand Down

0 comments on commit 2fe8980

Please sign in to comment.