File tree Expand file tree Collapse file tree 3 files changed +34
-4
lines changed
src/main/java/com/steamclock/steamclog Expand file tree Collapse file tree 3 files changed +34
-4
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ All notable changes to this project will be documented in this file.
33
44The format is based on the Steamclock [ Release Management Guide] ( https://github.com/steamclock/labs/wiki/Release-Management-Guide ) .
55
6- ## Unreleased
6+ ## Jitpack v2.4 : Aug 15, 2023
77- Allow more than one log to be attached to a Sentry report (#115 )
88- Fixed issue with log auto rotation (#115 )
99- Removed unused "track" code (#64 )
Original file line number Diff line number Diff line change @@ -18,7 +18,7 @@ afterEvaluate {
1818 // You can then customize attributes of the publication as shown below.
1919 groupId = ' com.steamclock.steamclog'
2020 artifactId = ' release'
21- version = ' v2.3 '
21+ version = ' v2.4 '
2222 }
2323 }
2424 }
@@ -37,8 +37,8 @@ android {
3737 defaultConfig {
3838 minSdkVersion 21
3939 targetSdkVersion versions. compileSdk
40- versionCode 3
41- versionName " 2.2 "
40+ versionCode 4
41+ versionName " 2.4 "
4242 consumerProguardFiles " consumer-rules.pro"
4343 }
4444
Original file line number Diff line number Diff line change 1+ package com.steamclock.steamclog
2+
3+ import android.content.Context
4+ import androidx.datastore.core.DataStore
5+ import androidx.datastore.preferences.preferencesDataStore
6+ import androidx.datastore.preferences.core.Preferences
7+ import androidx.datastore.preferences.core.booleanPreferencesKey
8+ import androidx.datastore.preferences.core.edit
9+ import kotlinx.coroutines.flow.Flow
10+ import kotlinx.coroutines.flow.map
11+
12+ /* *
13+ * https://developer.android.com/topic/libraries/architecture/datastore
14+ */
15+ class SClogDataStore (private val context : Context ) {
16+
17+ companion object {
18+ private val Context .SClogDataStore : DataStore <Preferences > by preferencesDataStore(name = " SClogDataStore" )
19+ private val hasLoggedFileCreationFailureKey = booleanPreferencesKey(" has_logged_file_creation_failure" )
20+ }
21+
22+ val getHasLoggedFileCreationFailure: Flow <Boolean >
23+ get() = context.SClogDataStore .data.map {
24+ it[hasLoggedFileCreationFailureKey] ? : true
25+ }
26+
27+ suspend fun setHasLoggedFileCreationFailure (value : Boolean ) {
28+ context.SClogDataStore .edit { it[hasLoggedFileCreationFailureKey] = value }
29+ }
30+ }
You can’t perform that action at this time.
0 commit comments