// Author: cirakg & claude ai // Summary: The latest settings results (README 10.3): kept in storage for the results screen, with an unseen flag for the list. import Toybox.Application; import Toybox.Lang; module Results { const KEY = "res"; const MAX_LINES = 60; // Replace the stored results with these lines (marked unseen). function save(lines as Array) as Void { var kept = lines.size() > MAX_LINES ? lines.slice(0, MAX_LINES) as Array : lines; Application.Storage.setValue(KEY, {"l" => kept, "u" => true} as Dictionary); } // The stored lines, or a short explanation when there are none. function lines() as Array { var stored = Application.Storage.getValue(KEY); if (stored instanceof Dictionary && stored["l"] instanceof Array) { return stored["l"] as Array; } return ["Nothing yet. Results appear here after you import or change entries in the phone settings."]; } function unseen() as Boolean { var stored = Application.Storage.getValue(KEY); return stored instanceof Dictionary && isTrue(stored["u"]); } function markSeen() as Void { var stored = Application.Storage.getValue(KEY); if (stored instanceof Dictionary && isTrue(stored["u"])) { stored["u"] = false; Application.Storage.setValue(KEY, stored as Dictionary); } } function isTrue(value as Application.Storage.ValueType) as Boolean { return value instanceof Boolean && value; } }