Skip to content

Commit

Permalink
Merge pull request #87 from boschglobal/fix-81
Browse files Browse the repository at this point in the history
Fix ConnectionInfo DataStore initialised again
  • Loading branch information
wba2hi authored Feb 28, 2024
2 parents f41d383 + 99cd0c2 commit 4a04367
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,6 @@ import org.eclipse.kuksa.testapp.databroker.model.ConnectionInfo
import org.eclipse.kuksa.testapp.databroker.model.ConnectionInfoSerializer

class ConnectionInfoRepository(context: Context) {

private val Context.dataStore: DataStore<ConnectionInfo> by dataStore(PREFERENCES_NAME, ConnectionInfoSerializer)
private val dataStore = context.dataStore

val connectionInfoFlow: Flow<ConnectionInfo> = dataStore.data
Expand All @@ -39,5 +37,9 @@ class ConnectionInfoRepository(context: Context) {

private companion object {
private const val PREFERENCES_NAME = "connection_info"
private val Context.dataStore: DataStore<ConnectionInfo> by dataStore(
PREFERENCES_NAME,
ConnectionInfoSerializer,
)
}
}

0 comments on commit 4a04367

Please sign in to comment.