davidsansome / tsurukame

Tsurukame is an unofficial WaniKani app for iOS. It helps you learn Japanese Kanji.
https://tsurukame.app
Apache License 2.0
249 stars 58 forks source link

Remember recent mistakes after full refresh #712

Closed Deadpikle closed 1 month ago

Deadpikle commented 2 months ago

In the current version of the app, because recent mistakes are stored in the local db, performing a full refresh from the WK server causes those mistakes to be lost, which can be very annoying if you do this accidentally.

This PR fixes that by:

  1. Before refresh, load recent mistakes in last 24 hrs from local db.
  2. After refresh and db updated, re-insert the recent mistake data into the local db.

NOTE: This does rely on subject IDs remaining the same before/after refresh. If only this data was easily available through the API 😞 Ideally these sorts of things this app stores would get synced to iCloud and thus show up on both macOS and iOS if you were using both devices or something, I suppose...

UInt2048 commented 2 months ago

I wonder if there's a way to get recent mistakes incorporating any new data the refresh provides, because people might have done reviews on another device