Persist exchange rates, selected currencies, and price source via SQLDelight
Adds a SQLDelight-backed AppDatabase (Android, Desktop, iOS/macOS) so the converter survives restarts: the last-known rates per price source, the user's selected fiat currencies (with order preserved), and the last-used price source all reload before the first network fetch completes. Web isn't a shipped platform and SQLDelight's driver there needs a worker plus a wasm sqlite binary, so it gets a lighter localStorage-backed implementation of the same store interfaces instead. Android needs an app Context for its driver, wired via a new SatsPriceApplication. iOS/macOS need libsqlite3 linked explicitly (Swift's autolinking only covers Shared.framework itself, not its C library dependencies), plus two extension-loading symbols marked optional since macOS's system sqlite build omits them. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QpjMKWGoiT5aJBzhxvXkwp
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
|
||||
|
||||
<application
|
||||
android:name=".SatsPriceApplication"
|
||||
android:allowBackup="true"
|
||||
android:icon="@mipmap/ic_launcher"
|
||||
android:label="@string/app_name"
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package xyz.tyiu.satsprice
|
||||
|
||||
import android.app.Application
|
||||
import xyz.tyiu.satsprice.data.db.initAndroidContext
|
||||
|
||||
class SatsPriceApplication : Application() {
|
||||
override fun onCreate() {
|
||||
super.onCreate()
|
||||
initAndroidContext(this)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user