Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
danielchalmers committed Jan 27, 2024
1 parent 63d00a7 commit 42ffbc4
Show file tree
Hide file tree
Showing 7 changed files with 17 additions and 18 deletions.
13 changes: 0 additions & 13 deletions JournalApp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,6 @@ VisualStudioVersion = 17.0.31611.283
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JournalApp", "JournalApp\JournalApp.csproj", "{DDDAF171-71A4-467A-BA11-9C4589CA0B3E}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{BC38128F-ED70-4D23-BA7C-E1E8DB5E5176}"
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.gitignore = .gitignore
.github\workflows\build-and-deploy.yml = .github\workflows\build-and-deploy.yml
Directory.Build.props = Directory.Build.props
global.json = global.json
LICENSE = LICENSE
PRIVACY_POLICY.md = PRIVACY_POLICY.md
README.md = README.md
version.json = version.json
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JournalApp.Tests", "JournalApp.Tests\JournalApp.Tests.csproj", "{3C1F4A08-B991-48DE-B7B6-014A7D427514}"
EndProject
Global
Expand Down
10 changes: 9 additions & 1 deletion JournalApp/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,27 @@ public App()
MainPage = new MainPage();
}

public static event EventHandler NewIntent;

public static Window Window { get; private set; }

public static string ActivatedFilePath { get; set; }

public static (DateTimeOffset LeftAt, DateOnly LastDate)? IndexDateState { get; set; }

public static event EventHandler NewIntent;
public int LaunchCount
{
get => Preferences.Get("launches", 0);
set => Preferences.Set("launches", value);
}

protected override Window CreateWindow(IActivationState activationState)
{
var window = base.CreateWindow(activationState);
Window = window;

LaunchCount++;

return window;
}

Expand Down
1 change: 1 addition & 0 deletions JournalApp/Components/Pages/ManageCategoriesPage.razor
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@

async Task OnEnabledChanged(DataPointCategory c, bool newValue)
{
logger.LogInformation($"Toggled category enabled <{c}, {newValue}>");
c.Enabled = newValue;
await db.SaveChangesAsync();
}
Expand Down
5 changes: 4 additions & 1 deletion JournalApp/Components/Pages/SettingsPage.razor
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,10 @@ else
<MudText>JournalApp @(ThisAssembly.AssemblyInformationalVersion)</MudText>
<MudText>@($"{DeviceInfo.Current.Platform} {DeviceInfo.Current.VersionString}")</MudText>

<MudLink Href="@(Feedback.GenerateLink())">Send feedback...</MudLink>
<MudLink Href="@(Feedback.GenerateLink())">Send feedback by email</MudLink>
<MudLink Href="https://github.com/danielchalmers/JournalApp/issues">Send feedback on GitHub</MudLink>
<MudLink Href="https://play.google.com/store/apps/details?id=com.danielchalmers.journalapp">View on Play Store</MudLink>
<MudLink Href="https://github.com/danielchalmers/JournalApp">View source code</MudLink>
</div>

<div class="settings-group">
Expand Down
2 changes: 1 addition & 1 deletion JournalApp/Data/AppDataService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public async Task<bool> StartImportWizard(IDialogService dialogService, string p
// Warn if an export wasn't done in the last week.
if (DateTimeOffset.Now > LastExportDate.AddDays(7) && await dialogService.ShowCustomMessageBox(string.Empty, "It's recommended to export your data first", yesText: "Continue anyway", cancelText: "Go back") == null)
{
logger.LogDebug("User didn't want to import and might export first");
logger.LogDebug("User didn't want to import after being warned about export");
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion JournalApp/Data/AppDbContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public HashSet<DataPoint> GetMissingPoints(Day day, DataPointCategory category,
// Randomize values.
if (random != null)
{
point.CreatedAt = new DateTime(day.Date, TimeOnly.FromTimeSpan(TimeSpan.FromHours(random.Next(1, 24))), DateTimeKind.Local);
point.CreatedAt = new DateTime(day.Date, TimeOnly.FromTimeSpan(TimeSpan.FromMinutes(random.Next(1, 1440))), DateTimeKind.Local);
point.Mood = DataPoint.Moods[random.Next(1, DataPoint.Moods.Count)];
point.SleepHours = random.Next(0, 49) / 2.0m;
point.ScaleIndex = random.Next(0, 6);
Expand Down
2 changes: 1 addition & 1 deletion JournalApp/Data/AppDbSeeder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public void SeedDb()
try
{
#if DEBUG && false
// This is so dangerous that it's kept in a block instead of me adding it and removing it as needed.
// This is so dangerous that it's kept in a block instead of being added and removed as needed.
db.Database.EnsureDeleted();
#endif
db.Database.Migrate();
Expand Down

0 comments on commit 42ffbc4

Please sign in to comment.