Skip to content

Commit

Permalink
🔥 Remove SettingsMigrations
Browse files Browse the repository at this point in the history
Signed-off-by: Leonardo Colman Lopes <[email protected]>
  • Loading branch information
LeoColman committed Feb 11, 2025
1 parent 24c22ef commit 3404592
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 75 deletions.
2 changes: 0 additions & 2 deletions app/src/main/kotlin/br/com/colman/petals/KoinModule.kt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ import app.cash.sqldelight.db.SqlDriver
import app.cash.sqldelight.driver.android.AndroidSqliteDriver
import br.com.colman.petals.hittimer.HitTimerRepository
import br.com.colman.petals.review.ReviewAppRequester
import br.com.colman.petals.settings.SettingsMigrations
import br.com.colman.petals.settings.SettingsRepository
import br.com.colman.petals.use.io.UseIOModules
import br.com.colman.petals.use.pause.repository.PauseRepository
Expand Down Expand Up @@ -59,6 +58,5 @@ val KoinModule = module {
single { PauseRepository(get<Database>().pauseQueries) }
single { HitTimerRepository(get<Context>().hitTimerPreferencesDataStore) }
single { SettingsRepository(get<Context>().settingsDatastore) }
single { SettingsMigrations(get<Context>().settingsDatastore) }
single { CensorshipRepository(get<Context>().blockDataStore) }
}
4 changes: 0 additions & 4 deletions app/src/main/kotlin/br/com/colman/petals/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ import br.com.colman.petals.R.string.pin_main_screen
import br.com.colman.petals.navigation.BottomNavigationBar
import br.com.colman.petals.navigation.MyTopAppBar
import br.com.colman.petals.navigation.NavHostContainer
import br.com.colman.petals.settings.SettingsMigrations
import br.com.colman.petals.settings.SettingsRepository
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.Dispatchers
Expand All @@ -59,13 +58,10 @@ class MainActivity : AppCompatActivity(), CoroutineScope by CoroutineScope(Dispa

private var authorizedUntil = LocalDateTime.MIN
private val settingsRepository by inject<SettingsRepository>()
private val settingsMigrations by inject<SettingsMigrations>()

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
settingsMigrations.migrateOldKeysValues()
settingsMigrations.removeOldKeysValues()
val navController = rememberNavController()

var isAuthorized by remember { mutableStateOf(false) }
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -112,17 +112,5 @@ class SettingsRepository(
val IsHitTimerMillisecondsEnabled = booleanPreferencesKey("is_hit_timer_milliseconds_enabled")
val IsDayExtended = booleanPreferencesKey("is_day_extended_enabled")
val IsHourOfDayLineInStatsEnabled = booleanPreferencesKey("is_hour_of_day_line_in_stats_enabled")

@Deprecated("This Key is no longer in use")
val ClockFormat = stringPreferencesKey("clock_format")

@Deprecated("This Key is no longer in use")
val MillisecondsEnabled = stringPreferencesKey("milliseconds_enabled")

@Deprecated("Use IsHitTimerMillisecondsEnabled instead", ReplaceWith("IsHitTimerMillisecondsEnabled"))
val HitTimerMillisecondsEnabled = stringPreferencesKey("hit_timer_milliseconds_enabled")

@Deprecated("Use IsDayExtendedEnabled instead", ReplaceWith("IsDayExtended"))
val ExtendedDayEnabled = stringPreferencesKey("is_day_extended")
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ import br.com.colman.petals.navigation.MyTopAppBar
import br.com.colman.petals.navigation.NavHostContainer
import br.com.colman.petals.playstore.settings.AdsSettingsRepository
import br.com.colman.petals.playstore.settings.view.AdFreeButton
import br.com.colman.petals.settings.SettingsMigrations
import br.com.colman.petals.settings.SettingsRepository
import com.google.android.gms.ads.MobileAds
import kotlinx.coroutines.CoroutineScope
Expand All @@ -32,15 +31,12 @@ class MainActivity : ComponentActivity(), CoroutineScope by CoroutineScope(Dispa

private val adsSettingsRepository by inject<AdsSettingsRepository>()
private val settingsRepository by inject<SettingsRepository>()
private val settingsMigrations by inject<SettingsMigrations>()

override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
MobileAds.initialize(this)

setContent {
settingsMigrations.migrateOldKeysValues()
settingsMigrations.removeOldKeysValues()
koin.loadModules(
listOf(
KoinModule
Expand Down

0 comments on commit 3404592

Please sign in to comment.