diff --git a/src/components/Bookmarks/BookmarkButton.vue b/src/components/Bookmarks/BookmarkButton.vue new file mode 100644 index 00000000..2bf216ad --- /dev/null +++ b/src/components/Bookmarks/BookmarkButton.vue @@ -0,0 +1,115 @@ + + + + + + + \ No newline at end of file diff --git a/src/components/BookmarkDialog.vue b/src/components/Bookmarks/BookmarkDialog.vue similarity index 52% rename from src/components/BookmarkDialog.vue rename to src/components/Bookmarks/BookmarkDialog.vue index a666ddc9..b5bcb143 100644 --- a/src/components/BookmarkDialog.vue +++ b/src/components/Bookmarks/BookmarkDialog.vue @@ -1,14 +1,14 @@ @@ -92,7 +90,7 @@ import {toTitleCase} from "../../utils/string"; import {shortcutOnly} from "../../utils/tz"; import MenuToolbar from "./MenuToolbar"; import Tags from "../../components/Tags"; -import BookmarkDialog from "@/components/BookmarkDialog.vue"; +import BookmarkButton from "../../components/Bookmarks/BookmarkButton.vue"; import {openTzktContract} from "../../utils/tzkt"; import {DATA_LOADING_STATUSES} from "../../utils/network"; import {applyStyles} from "../../utils/styles"; @@ -104,7 +102,7 @@ export default { components: { Tags, MenuToolbar, - BookmarkDialog + BookmarkButton, }, props: { network: String, @@ -123,8 +121,6 @@ export default { isComboBoxExpanded: false, onChainViews: [], onChainViewsLoadingStatus: DATA_LOADING_STATUSES.NOTHING, - isBookmark: false, - openBookMarkDialog: false, alias: undefined }), computed: { @@ -175,9 +171,6 @@ export default { ]; }, }, - created() { - this.getInfo(); - }, destroyed() { this.hideError(); }, @@ -219,13 +212,12 @@ export default { this.isComboBoxExpanded = false; }, async init() { + await this.getInfo(); this.tokensTotal = 0; this.metadata = null; this.alias = await this.getAlias(this.network, this.address); if (this.isContract) { - this.bookmarks.registerObserver(this.onBookmarkStateChanged); - this.detectBookmark(); this.getContract(); this.loadOnChainViews(); } else { @@ -295,49 +287,8 @@ export default { this.showError(err); }); }, - bookmarkState() { - let key = `${this.network}_${this.address}`; - if (this.isBookmark) { - this.bookmarks.remove(key); - } else { - this.openBookMarkDialog = !this.openBookMarkDialog; - this.name = this.alias || ""; - - } - }, - detectBookmark() { - let key = `${this.network}_${this.address}`; - let bookmarks = this.bookmarks.getAll(); - this.isBookmark = bookmarks[key] !== undefined; - }, - onBookmarkStateChanged(event, key) { - let currentKey = `${this.network}_${this.address}`; - if (currentKey !== key) { - return; - } - if (event === 'remove') { - this.isBookmark = false; - } else { - this.isBookmark = true; - } - }, - onBookmarkAdded(value) { - let key = `${this.network}_${this.address}`; - this.bookmarks.add(key, { - network: this.network, - address: this.address, - alias: value || this.alias, - }) - this.openBookMarkDialog = false; - }, }, watch: { - accountType: { - immediate: true, - handler() { - this.init(); - } - }, address: { immediate: true, handler() { diff --git a/src/views/contract/InteractTab.vue b/src/views/contract/InteractTab.vue index f4080124..dcb76a91 100644 --- a/src/views/contract/InteractTab.vue +++ b/src/views/contract/InteractTab.vue @@ -20,6 +20,13 @@ NO NAME + @@ -73,6 +80,7 @@ import { applyStyles } from '@/utils/styles.js'; import { isOperationHash } from '@/utils/tz.js'; import Schema from "@/components/schema/Schema.vue"; import TypeDef from "@/views/contract/TypeDef"; +import BookmarkButton from "../../components/Bookmarks/BookmarkButton.vue"; export default { name: "InteractTab", @@ -84,7 +92,8 @@ export default { }, components: { Schema, - TypeDef + TypeDef, + BookmarkButton, }, data: () => ({ loading: true, diff --git a/src/views/contract/MenuToolbar.vue b/src/views/contract/MenuToolbar.vue index 44d5b6dd..920b84f5 100644 --- a/src/views/contract/MenuToolbar.vue +++ b/src/views/contract/MenuToolbar.vue @@ -71,7 +71,7 @@ export default { text: 'Code', },{ to: this.pushTo({ name: 'interact' }), - icon: 'play-box-outline', + icon: 'mdi-play-box-outline', text: 'Interact', }) diff --git a/src/views/opg/CallStackItem.vue b/src/views/opg/CallStackItem.vue index 3ebaff02..124f6e55 100644 --- a/src/views/opg/CallStackItem.vue +++ b/src/views/opg/CallStackItem.vue @@ -39,7 +39,7 @@ export default { }, setClassAndValue() { if (this.operation.tag) { - this.itemClass = "'hash accent--text'"; + this.itemClass = 'hash accent--text'; this.itemValue = 'event ' + this.operation.tag; } else if (this.operation.kind === 'transfer_ticket') { this.itemClass = 'hash accent--text';