Skip to content

Commit 21b7199

Browse files
committed
Always call DbArchive variables dbArchive
1 parent acfc0a0 commit 21b7199

File tree

1 file changed

+6
-6
lines changed
  • pacmc-app/src/commonMain/kotlin/net/axay/pacmc/app/features

1 file changed

+6
-6
lines changed

pacmc-app/src/commonMain/kotlin/net/axay/pacmc/app/features/Archive.kt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -179,14 +179,14 @@ class Archive(val name: String) {
179179
}
180180

181181
private suspend fun uninstall(modId: ModId): TransactionPartResult {
182-
val archive = realm.findArchive()
182+
val dbArchive = realm.findArchive()
183183

184184
val wasPresent = realm.write {
185-
findLatest(archive)!!.installed.removeAll { it.readModId() == modId }
185+
findLatest(dbArchive)!!.installed.removeAll { it.readModId() == modId }
186186
}
187187

188188
var removedAny = false
189-
Environment.fileSystem.list(archive.readPath()).forEach {
189+
Environment.fileSystem.list(dbArchive.readPath()).forEach {
190190
if (it.isArchiveFile() && ModFile.modIdFromPath(it) == modId) {
191191
removedAny = true
192192
Environment.fileSystem.delete(path = it, mustExist = false)
@@ -215,11 +215,11 @@ class Archive(val name: String) {
215215
}
216216

217217
suspend fun prepareRefresh() {
218-
val archive = realm.findArchive()
218+
val dbArchive = realm.findArchive()
219219
realm.write {
220-
findLatest(archive)!!.installed.removeAll { it.dependency }
220+
findLatest(dbArchive)!!.installed.removeAll { it.dependency }
221221
}
222-
Environment.fileSystem.list(archive.readPath()).forEach {
222+
Environment.fileSystem.list(dbArchive.readPath()).forEach {
223223
if (it.isArchiveFile()) {
224224
Environment.fileSystem.delete(it, mustExist = false)
225225
}

0 commit comments

Comments
 (0)