From cb953ea8a8c635f4ce282d7b2268128a725d2cb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kuba=20Szczodrzy=C5=84ski?= Date: Sat, 30 Oct 2021 21:47:59 +0200 Subject: [PATCH] [Config] Fix only notes card visible on new profiles. --- .../edziennik/config/utils/ProfileConfigMigration.kt | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/pl/szczodrzynski/edziennik/config/utils/ProfileConfigMigration.kt b/app/src/main/java/pl/szczodrzynski/edziennik/config/utils/ProfileConfigMigration.kt index 62122a37..57177899 100644 --- a/app/src/main/java/pl/szczodrzynski/edziennik/config/utils/ProfileConfigMigration.kt +++ b/app/src/main/java/pl/szczodrzynski/edziennik/config/utils/ProfileConfigMigration.kt @@ -37,8 +37,10 @@ class ProfileConfigMigration(config: ProfileConfig) { } if (dataVersion < 3) { - ui.homeCards = ui.homeCards.toMutableList().also { - it.add(HomeCardModel(config.profileId, HomeCard.CARD_NOTES)) + if (ui.homeCards.isNotEmpty()) { + ui.homeCards = ui.homeCards.toMutableList().also { + it.add(HomeCardModel(config.profileId, HomeCard.CARD_NOTES)) + } } dataVersion = 3