- The first screen is three cards you scroll through: what you could have (your family's photos at home, open from anywhere), how it works (a small computer that stays on, and an address of your own), and the question that matters: does your home have one? - As you scroll down, the first two cards fold into two bubbles at the top. Tap a bubble to go back to its card. - The last card ends with a choice: "Yes, let's find out" starts the check; "Not for me" says goodbye and closes the app. - After your first check, the app opens on the last card, with the first two already folded. - The swipe-through pages and the circling drawing are gone; the six things you could host stay listed under the cards. - While a check runs, nothing is left empty: each thing you could host has its card from the start, with a "Checking" label and a moving shimmer, until its answer arrives. Checks still running look the same. - The question, the two answers and the goodbye are in every language; translations other than English and Italian are still drafts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012CzABvBkbcFqoHdmi8b9WB
46 lines
1.3 KiB
C#
46 lines
1.3 KiB
C#
using System.Text.Json;
|
|
|
|
namespace MeWeb.App.Services;
|
|
|
|
public class StoredSettings
|
|
{
|
|
public string Language { get; set; }
|
|
|
|
public bool StorySeen { get; set; }
|
|
}
|
|
|
|
public static class AppSettings
|
|
{
|
|
static readonly string Folder = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "MeWeb");
|
|
static readonly string FilePath = Path.Combine(Folder, "settings.json");
|
|
|
|
public static StoredSettings Read()
|
|
{
|
|
try
|
|
{
|
|
if (!File.Exists(FilePath)) return new StoredSettings();
|
|
using var stream = File.OpenRead(FilePath);
|
|
return JsonSerializer.Deserialize(stream, AppJsonContext.Default.StoredSettings) ?? new StoredSettings();
|
|
}
|
|
catch (Exception ex) when (ex is IOException or JsonException or UnauthorizedAccessException)
|
|
{
|
|
return new StoredSettings();
|
|
}
|
|
}
|
|
|
|
public static void Write(StoredSettings settings)
|
|
{
|
|
try
|
|
{
|
|
Directory.CreateDirectory(Folder);
|
|
var temporary = FilePath + ".tmp";
|
|
using (var stream = File.Create(temporary))
|
|
JsonSerializer.Serialize(stream, settings, AppJsonContext.Default.StoredSettings);
|
|
File.Move(temporary, FilePath, overwrite: true);
|
|
}
|
|
catch (Exception ex) when (ex is IOException or UnauthorizedAccessException)
|
|
{
|
|
}
|
|
}
|
|
}
|