From b21d36b9d4bfb9a1620da422db19df70e7f18702 Mon Sep 17 00:00:00 2001 From: Shubert Munthali Date: Sun, 11 Aug 2024 17:08:07 +0200 Subject: [PATCH] Refactor NoteExt --- app/src/main/java/dev/arkbuilders/arkmemo/utils/NoteExt.kt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/dev/arkbuilders/arkmemo/utils/NoteExt.kt b/app/src/main/java/dev/arkbuilders/arkmemo/utils/NoteExt.kt index ebb02435..a53473ee 100644 --- a/app/src/main/java/dev/arkbuilders/arkmemo/utils/NoteExt.kt +++ b/app/src/main/java/dev/arkbuilders/arkmemo/utils/NoteExt.kt @@ -11,8 +11,8 @@ fun Note.getAutoTitle(context: Context? = null): String { return if (context != null) { when (this) { is TextNote -> { - title.ifEmpty { this.text.take(20) }.ifEmpty { - context?.getString(R.string.ark_memo_default_text_note_title) ?: "" + title.ifEmpty { text.take(20) }.ifEmpty { + context.getString(R.string.ark_memo_default_text_note_title) ?: "" } }