From ee0663e5e5be5b1676542c9fa243b55e843e0533 Mon Sep 17 00:00:00 2001 From: Felix Wiemuth <533601+felixwiemuth@users.noreply.github.com> Date: Sun, 2 Oct 2022 12:19:11 +0200 Subject: [PATCH] Fix code style --- .../isoron/uhabits/core/preferences/Preferences.kt | 12 ++++++++---- .../isoron/uhabits/core/ui/NotificationTrayTest.kt | 2 +- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/uhabits-core/src/jvmMain/java/org/isoron/uhabits/core/preferences/Preferences.kt b/uhabits-core/src/jvmMain/java/org/isoron/uhabits/core/preferences/Preferences.kt index 37d0b6e06..71308e8a1 100644 --- a/uhabits-core/src/jvmMain/java/org/isoron/uhabits/core/preferences/Preferences.kt +++ b/uhabits-core/src/jvmMain/java/org/isoron/uhabits/core/preferences/Preferences.kt @@ -155,14 +155,18 @@ open class Preferences(private val storage: Storage) { } else { try { val activeById = Json.decodeFromString( - MapSerializer(Long.serializer(), NotificationTray.NotificationData.serializer()), + MapSerializer( + Long.serializer(), + NotificationTray.NotificationData.serializer() + ), serialized ) - val activeByHabit = activeById.mapNotNull { (id, v) -> habitList.getById(id)?.let { it to v } } + val activeByHabit = + activeById.mapNotNull { (id, v) -> habitList.getById(id)?.let { it to v } } activeByHabit.toMap(HashMap()) - } catch (e : IllegalArgumentException) { + } catch (e: IllegalArgumentException) { HashMap() - } catch (e : SerializationException) { + } catch (e: SerializationException) { HashMap() } } diff --git a/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/ui/NotificationTrayTest.kt b/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/ui/NotificationTrayTest.kt index 931386367..2febcf3f1 100644 --- a/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/ui/NotificationTrayTest.kt +++ b/uhabits-core/src/jvmTest/java/org/isoron/uhabits/core/ui/NotificationTrayTest.kt @@ -122,4 +122,4 @@ class NotificationTrayTest : BaseUnitTest() { // TODO test cases where reminders should be removed (e.g. reshowAll) } -} \ No newline at end of file +}