Updated on 2026-08-14
This commit is contained in:
parent
fc223990a4
commit
9fd13fdc46
11 changed files with 149 additions and 176 deletions
|
|
@ -7,4 +7,6 @@ interface AppsFlyerConversionStore {
|
|||
suspend fun get(): AppsFlyerConversionData?
|
||||
|
||||
suspend fun store(value: AppsFlyerConversionData)
|
||||
|
||||
suspend fun storeIfAbsent(value: AppsFlyerConversionData)
|
||||
}
|
||||
|
|
@ -29,6 +29,17 @@ internal class DefaultAppsFlyerConversionStore(
|
|||
appPreferencesStore.storeObject(KEY, dto)
|
||||
}
|
||||
|
||||
override suspend fun storeIfAbsent(value: AppsFlyerConversionData) {
|
||||
Timber.i("Storing conversion data to store if absent: $value")
|
||||
|
||||
val dto = appPreferencesStore.getObjectSyncOrNull<ConversionDataDTO>(KEY)
|
||||
|
||||
if (dto == null) {
|
||||
Timber.i("Conversion data is absent, storing $value")
|
||||
appPreferencesStore.storeObject(KEY, ConversionDataConverter.convert(value))
|
||||
}
|
||||
}
|
||||
|
||||
private companion object {
|
||||
|
||||
val KEY = stringPreferencesKey("APPS_FLYER_CONVERSION_DATA")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue