mirror of
https://github.com/VGEAREN/Stockbar.git
synced 2026-10-07 14:58:08 +08:00
- AppState.init: use _stocks = Published(wrappedValue:) to bypass didSet, preventing empty array from overwriting disk on decode failure - AppState.saveStocks: guard against overwriting non-empty file with [] - Stock: explicit Codable extension using decodeIfPresent for optional fields, so missing fields in old JSON use defaults instead of failing the whole decode Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>