From 845f19eab62f20b0d203429eb854ed3ac9e3332d Mon Sep 17 00:00:00 2001 From: MohitMali Date: Wed, 1 Nov 2023 16:51:52 +0530 Subject: [PATCH] Fixed #3519. * The problem was that we were saving the note name combined with `zimFileTitle` and `articleTitle`. When opening the saved note from `NotesFragment`, it retrieved the `noteTitle` from the database, which already contained the combined name. Subsequently, when saving the note again, it redundantly combined the name. To resolve this issue, we now extract the `articleName` when updating notes in `NotesFragment`, ensuring that it updates existing notes instead of creating new ones. --- .../main/java/org/kiwix/kiwixmobile/core/main/AddNoteDialog.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/main/java/org/kiwix/kiwixmobile/core/main/AddNoteDialog.kt b/core/src/main/java/org/kiwix/kiwixmobile/core/main/AddNoteDialog.kt index dc52f0ff4..5cd95a7f7 100644 --- a/core/src/main/java/org/kiwix/kiwixmobile/core/main/AddNoteDialog.kt +++ b/core/src/main/java/org/kiwix/kiwixmobile/core/main/AddNoteDialog.kt @@ -123,7 +123,7 @@ class AddNoteDialog : DialogFragment() { zimId = zimReaderContainer.id.orEmpty() if (arguments != null) { - articleTitle = arguments?.getString(NOTES_TITLE) + articleTitle = arguments?.getString(NOTES_TITLE)?.substringAfter(": ") zimFileUrl = arguments?.getString(ARTICLE_URL).orEmpty() } else { val webView = (activity as WebViewProvider?)?.getCurrentWebView()