diff --git a/_locales/en/messages.json b/_locales/en/messages.json index 86e4afb17d..f97ccfe7a7 100644 --- a/_locales/en/messages.json +++ b/_locales/en/messages.json @@ -767,5 +767,8 @@ }, "DescriptionDisabledaftererror": { "message": "Retried 10 times before disabling this profile" + }, + "DescriptionBookmarkexists": { + "message": "This bookmark exists already in the selected profile" } } diff --git a/src/ui/views/native/AddBookmarkIntent.vue b/src/ui/views/native/AddBookmarkIntent.vue index 147e81d0ee..62e0717d6d 100644 --- a/src/ui/views/native/AddBookmarkIntent.vue +++ b/src/ui/views/native/AddBookmarkIntent.vue @@ -3,11 +3,6 @@ - - mdi-arrow-left - Add Bookmark - + {{ item.data.type | accountIcon }} {{ item.label }} + + {{ t('DescriptionBookmarkexists') }} + import { routes } from '../../NativeRouter' import { actions } from '../../store/definitions' -import { Bookmark } from '../../../lib/Tree' +import { Bookmark, ItemType } from '../../../lib/Tree' import DialogChooseFolder from '../../components/native/DialogChooseFolder' import { SendIntent } from 'send-intent' @@ -87,7 +93,8 @@ export default { const icons = { 'google-drive': 'mdi-google-drive', 'nextcloud-bookmarks': 'mdi-cloud', - 'webdav': 'mdi-folder-network' + 'webdav': 'mdi-folder-network', + 'git': 'mdi-source-repository', } return icons[type] }, @@ -129,6 +136,9 @@ export default { } const folder = this.tree.findFolder(this.temporaryParent) return folder ? folder.title || this.t('LabelUntitledfolder') : '' + }, + exists() { + return !this.loading && this.tree && this.tree.findItemFilter(ItemType.BOOKMARK, (bm) => bm.url === this.url) } }, watch: { @@ -136,6 +146,9 @@ export default { if (this.loading) return this.data = this.$store.state.accounts[this.id].data }, + id() { + this.$store.dispatch(actions.LOAD_TREE, this.id) + }, url() { this.urlError = null try {