Skip to content

Commit

Permalink
Fix: check Destination field in operaion view on search page
Browse files Browse the repository at this point in the history
  • Loading branch information
aopoltorzhicky committed Jul 18, 2023
1 parent aabe121 commit 40f58a3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/views/extended_search/result/Operation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<router-link class="serp-link" target="_blank" :to="link">
<span v-if="item.body.Entrypoint" class="hash">{{ item.body.Entrypoint + '()' }}</span>
<span v-else-if="item.body.Type === 'origination'">origination</span>
<Shortcut v-else-if="item.body.Destination.startsWith('KT')" :str="item.body.Hash"/>
<Shortcut v-else-if="isDestinationContract" :str="item.body.Hash"/>
<span v-else class="hash">{{ item.body.Hash }}</span>
</router-link>
</v-list-item-title>
Expand All @@ -34,6 +34,7 @@
<script>
import Highlight from './Highlight.vue';
import Shortcut from '@/components/Shortcut.vue';
import {isKT1Address} from "@/utils/tz";
export default {
name: "Operation",
Expand All @@ -57,6 +58,12 @@ export default {
return `/${this.item.body.Network}/opg/${this.item.body.Hash}`;
}
return '';
},
isDestinationContract() {
if (this.item.body.Destination){
return isKT1Address(this.item.body.Destination)
}
return false;
}
}
}
Expand Down

0 comments on commit 40f58a3

Please sign in to comment.