From bed7ca20fb34fdff02fa751e35fbfe0efab5d6e1 Mon Sep 17 00:00:00 2001 From: Noelia Date: Mon, 31 Jan 2022 12:19:40 +0100 Subject: [PATCH] fix(@desktop/browser): [base_bc] renaming bookmark is not persistent Edit existing bookmark name is now correctly updated in the view. Fixes #4549 --- src/app_service/service/bookmarks/service.nim | 1 + ui/app/AppLayouts/Browser/popups/FavoriteMenu.qml | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/app_service/service/bookmarks/service.nim b/src/app_service/service/bookmarks/service.nim index 5a788e0c02..7718bdd040 100644 --- a/src/app_service/service/bookmarks/service.nim +++ b/src/app_service/service/bookmarks/service.nim @@ -67,6 +67,7 @@ method updateBookmark*(self: Service, oldUrl, newUrl, newName: string): R = let response = status_go.updateBookmark(oldUrl, newUrl, newName).result self.bookmarks.del(oldUrl) + self.bookmarks[newUrl] = BookmarkDto() self.bookmarks[newUrl].url = newUrl self.bookmarks[newUrl].name = newName discard response.getProp("imageUrl", self.bookmarks[newurl].imageUrl) diff --git a/ui/app/AppLayouts/Browser/popups/FavoriteMenu.qml b/ui/app/AppLayouts/Browser/popups/FavoriteMenu.qml index 342529aada..77033c1ad5 100644 --- a/ui/app/AppLayouts/Browser/popups/FavoriteMenu.qml +++ b/ui/app/AppLayouts/Browser/popups/FavoriteMenu.qml @@ -39,7 +39,11 @@ PopupMenu { icon.source: Style.svg("edit") icon.width: 16 icon.height: 16 - onTriggered: editFavoriteTriggered() + onTriggered: { + // Force reloading current favorite as it could have been modified when edited: + favoritePopupMenu.currentFavorite = BookmarksStore.getCurrentFavorite(url) + editFavoriteTriggered() + } } Action {