Skip to content

Commit 61055f9

Browse files
authored
Feature: Tweaked logic for prompt to review (#11223)
1 parent 94336cf commit 61055f9

File tree

3 files changed

+16
-9
lines changed

3 files changed

+16
-9
lines changed

src/Files.App/ServicesImplementation/Settings/ApplicationSettingsService.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ namespace Files.App.ServicesImplementation.Settings
55
{
66
internal sealed class ApplicationSettingsService : BaseObservableJsonSettings, IApplicationSettingsService
77
{
8-
public bool WasPromptedToReview
8+
public bool ClickedToReviewApp
99
{
1010
get => Get(false);
1111
set => Set(value);

src/Files.App/Views/MainPage.xaml.cs

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,11 @@ private async Task PromptForReview()
8989
{
9090
var storeContext = StoreContext.GetDefault();
9191
await storeContext.RequestRateAndReviewAppAsync();
92+
93+
UserSettingsService.ApplicationSettingsService.ClickedToReviewApp = true;
9294
}
9395
catch (Exception) { }
9496
}
95-
96-
UserSettingsService.ApplicationSettingsService.WasPromptedToReview = true;
9797
}
9898

9999
// WINUI3
@@ -312,14 +312,21 @@ private void Page_Loaded(object sender, RoutedEventArgs e)
312312
FindName(nameof(TabControl));
313313
FindName(nameof(NavToolbar));
314314

315-
// Prompt user to review app in the Store
315+
if (Package.Current.Id.Name != "49306atecsolution.FilesUWP" || UserSettingsService.ApplicationSettingsService.ClickedToReviewApp)
316+
return;
317+
318+
var totalLaunchCount = SystemInformation.Instance.TotalLaunchCount;
319+
316320
if
317321
(
318-
SystemInformation.Instance.TotalLaunchCount >= 15 &
319-
Package.Current.Id.Name == "49306atecsolution.FilesUWP" &&
320-
!UserSettingsService.ApplicationSettingsService.WasPromptedToReview
322+
totalLaunchCount == 10 ||
323+
totalLaunchCount == 20 ||
324+
totalLaunchCount == 30 ||
325+
totalLaunchCount == 40 ||
326+
totalLaunchCount == 50
321327
)
322328
{
329+
// Prompt user to review app in the Store
323330
DispatcherQueue.TryEnqueue(async () => await PromptForReview());
324331
}
325332
}

src/Files.Backend/Services/Settings/IApplicationSettingsService.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
public interface IApplicationSettingsService : IBaseSettingsService
44
{
55
/// <summary>
6-
/// Gets or sets a value indicating whether or not the user was prompted to review the app.
6+
/// Gets or sets a value indicating whether or not the user clicked to review the app.
77
/// </summary>
8-
bool WasPromptedToReview { get; set; }
8+
bool ClickedToReviewApp { get; set; }
99

1010
}
1111
}

0 commit comments

Comments
 (0)