-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(deps): update dependency dev.chrisbanes.compose:compose-bom to v2…
…024.06.00-alpha01 (#60) * feat(ui): Add restoring & syncing banner * fix(deps): update dependency dev.chrisbanes.compose:compose-bom to v2024.06.00-alpha01 --------- Co-authored-by: Cuong-Tran <[email protected]> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
- Loading branch information
1 parent
b53b099
commit d5cf010
Showing
8 changed files
with
124 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
app/src/main/java/eu/kanade/tachiyomi/data/backup/restore/BackupRestoreStatus.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package eu.kanade.tachiyomi.data.backup.restore | ||
|
||
import kotlinx.coroutines.CoroutineScope | ||
import kotlinx.coroutines.Dispatchers | ||
import kotlinx.coroutines.flow.MutableStateFlow | ||
import kotlinx.coroutines.flow.SharingStarted | ||
import kotlinx.coroutines.flow.debounce | ||
import kotlinx.coroutines.flow.stateIn | ||
|
||
class BackupRestoreStatus { | ||
private val scope = CoroutineScope(Dispatchers.IO) | ||
|
||
private val _isRunning = MutableStateFlow(false) | ||
|
||
val isRunning = _isRunning | ||
.debounce(1000L) // Don't notify if it finishes quickly enough | ||
.stateIn(scope, SharingStarted.WhileSubscribed(), false) | ||
|
||
suspend fun start() { | ||
_isRunning.emit(true) | ||
} | ||
|
||
suspend fun stop() { | ||
_isRunning.emit(false) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
app/src/main/java/eu/kanade/tachiyomi/data/sync/SyncStatus.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package eu.kanade.tachiyomi.data.sync | ||
|
||
import kotlinx.coroutines.CoroutineScope | ||
import kotlinx.coroutines.Dispatchers | ||
import kotlinx.coroutines.flow.MutableStateFlow | ||
import kotlinx.coroutines.flow.SharingStarted | ||
import kotlinx.coroutines.flow.debounce | ||
import kotlinx.coroutines.flow.stateIn | ||
|
||
class SyncStatus { | ||
private val scope = CoroutineScope(Dispatchers.IO) | ||
|
||
private val _isRunning = MutableStateFlow(false) | ||
|
||
val isRunning = _isRunning | ||
.debounce(1000L) // Don't notify if it finishes quickly enough | ||
.stateIn(scope, SharingStarted.WhileSubscribed(), false) | ||
|
||
suspend fun start() { | ||
_isRunning.emit(true) | ||
} | ||
|
||
suspend fun stop() { | ||
_isRunning.emit(false) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters