Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
machiav3lli committed Dec 11, 2024
1 parent df3ac3e commit 137dbdb
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 11 deletions.
1 change: 0 additions & 1 deletion src/main/java/com/machiav3lli/backup/OABX.kt
Original file line number Diff line number Diff line change
Expand Up @@ -459,7 +459,6 @@ class OABX : Application() {
mainRef = WeakReference(mainActivity)
}
var mainSaved: MainActivityX? = null // just to see if activity changed
var viewModelSaved: ViewModel? = null

var appsSuspendedChecked = false

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,6 @@ class MainActivityX : BaseActivity() {

super.onCreate(savedInstanceState)

Timber.d(
"viewModel: ${
classAndId(viewModel)
}, was ${
classAndId(OABX.viewModelSaved)
}"
)

//TODO wech begin ??? or is this necessary with resume or similar?

//TODO here or in MainPage? MainPage seems to be weird at least for each recomposition
Expand Down Expand Up @@ -318,7 +310,6 @@ class MainActivityX : BaseActivity() {
}

override fun onDestroy() {
OABX.viewModelSaved = viewModel
OABX.mainSaved = OABX.main
OABX.main = null
super.onDestroy()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ import kotlinx.coroutines.asCoroutineDispatcher
import kotlinx.coroutines.delay
import kotlinx.coroutines.launch
import kotlinx.coroutines.yield
import org.koin.androidx.compose.koinViewModel
import org.koin.compose.koinInject
import java.util.concurrent.Executors
import kotlin.math.roundToInt
Expand Down Expand Up @@ -235,12 +236,12 @@ fun TextInputMenuItem(
@Composable
fun Selections(
action: MenuAction,
viewModel: MainVM = koinViewModel(),
selection: Set<String> = emptySet(),
onAction: (Set<String>) -> Unit = {},
) {
val backupRoot = koinInject<Context>().getBackupRoot()
val scope = rememberCoroutineScope()
val viewModel = koinInject<MainVM>()
val selectionsDir = backupRoot.findFile(SELECTIONS_FOLDER_NAME)
?: backupRoot.createDirectory(SELECTIONS_FOLDER_NAME)
val files = selectionsDir.listFiles()
Expand Down

0 comments on commit 137dbdb

Please sign in to comment.