Skip to content

Commit

Permalink
chore: Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
morning4coffe-dev committed Mar 28, 2024
1 parent 1d44b8d commit f76f632
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 10 deletions.
4 changes: 2 additions & 2 deletions ProjectSBS/ProjectSBS.Windows/Package.appxmanifest
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>

<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
Expand All @@ -12,7 +12,7 @@
<Identity
Name="3597CaffeStudios.Recurrents"
Publisher="CN=A4324CBF-D4DD-41DE-9042-BB3AA1508016"
Version="0.9.30.0" />
Version="0.9.40.0" />

<mp:PhoneIdentity PhoneProductId="b5323638-1e69-4644-a27d-9487a55d21ff" PhonePublisherId="00000000-0000-0000-0000-000000000000" />

Expand Down
4 changes: 3 additions & 1 deletion ProjectSBS/ProjectSBS/App.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@ protected override async void OnLaunched(LaunchActivatedEventArgs args)
// Ensure the current window is active
MainWindow.Activate();

#if !HAS_UNO //&& !DEBUG
#if !HAS_UNO && !DEBUG
AnalyticsService.Initialize();

//TODO Always returns v1 on WinUI3
//var version = Services?.GetRequiredService<IInteropService>().GetAppVersion();

Expand Down
20 changes: 15 additions & 5 deletions ProjectSBS/ProjectSBS/Business/ViewModels/HomeViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,11 @@ private void AddNew()
[RelayCommand]
public async Task Archive(ItemViewModel? item = null)
{
if (item is not { } && SelectedItem is not { })
{
return;
}

ContentDialogResult result;

if (!(item ?? SelectedItem).IsArchived)
Expand All @@ -260,17 +265,22 @@ public async Task Archive(ItemViewModel? item = null)
{
_itemService.ArchiveItem(item ?? SelectedItem);

SelectedItem = null;
RefreshItems();

AnalyticsService.TrackEvent(AnalyticsService.ItemEvent, "Archived",
(item ?? SelectedItem).IsArchived.ToString());

SelectedItem = null;
RefreshItems();
}
}

[RelayCommand]
public async Task Delete(ItemViewModel? item = null)
{
if (item is not { } && SelectedItem is not { })
{
return;
}

var result = await _dialog.ShowAsync(
_localizer["DeleteDialogTitle"],
_localizer["DeleteDialogDescription"],
Expand All @@ -280,10 +290,10 @@ public async Task Delete(ItemViewModel? item = null)
{
_itemService.DeleteItem(item ?? SelectedItem);

AnalyticsService.TrackEvent(AnalyticsService.ItemEvent, "Deleted", "True");

SelectedItem = null;
RefreshItems();

AnalyticsService.TrackEvent(AnalyticsService.ItemEvent, "Deleted", "True");
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
MaxWidth="300"
Margin="20" />

<TextBlock Text="{cme:Localize Name=ArchiveEmptyTitle}"
<TextBlock Text="{cme:Localize Name=ItemsEmptyTitle}"
TextWrapping="WrapWholeWords"
HorizontalAlignment="Center"
FontWeight="Bold" />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class AnalyticsService
public const string LogIn = "02_LogIn";
public const string ItemEvent = "03_ItemEvent";

public AnalyticsService()
public static void Initialize()
{
#if !HAS_UNO && !DEBUG
AppCenter.Start(AppConfig.TelemetryId,
Expand Down

0 comments on commit f76f632

Please sign in to comment.