Skip to content
This repository has been archived by the owner on Nov 20, 2023. It is now read-only.

Commit

Permalink
refactor: reorder vals
Browse files Browse the repository at this point in the history
  • Loading branch information
Axelen123 committed Aug 3, 2023
1 parent 3ad5a23 commit a3f9705
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ sealed class PatchBundleSource(val name: String, val uid: Int, directory: File)
protected val patchesFile = directory.resolve("patches.jar")
protected val integrationsFile = directory.resolve("integrations.apk")

private val _state = MutableStateFlow(load())
val state = _state.asStateFlow()

/**
* Returns true if the bundle has been downloaded to local storage.
*/
Expand All @@ -29,13 +32,11 @@ sealed class PatchBundleSource(val name: String, val uid: Int, directory: File)
State.Failed(t)
}
}

fun reload() {
_state.value = load()
}

private val _state = MutableStateFlow(load())
val state = _state.asStateFlow()

sealed interface State {
fun patchBundleOrNull(): PatchBundle? = null

Expand Down

0 comments on commit a3f9705

Please sign in to comment.