Skip to content

Commit

Permalink
Fix: check Destination field in operation view on search page (baking…
Browse files Browse the repository at this point in the history
  • Loading branch information
aopoltorzhicky authored Jul 18, 2023
1 parent 2b8a0c7 commit 276afcf
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/views/extended_search/result/Operation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<v-list-item-title>
<span class="hash">Operation</span>
<span class="text--secondary" style="font-size: 20px;"> → </span>
<template v-if="item.body.Destination.startsWith('KT')">
<template v-if="isDestinationContract">
<router-link class="serp-link" target="_blank" :to="`/${item.body.Network}/${item.body.Destination}`">
<Shortcut :str="item.body.Destination"/>
</router-link>
Expand All @@ -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"/>
<span v-else-if="isDestinationContract">default()</span>
<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 276afcf

Please sign in to comment.