OSDN Git Service

fixed the delay tx list issue
authorZhiting Lin <zlin035@uottawa.ca>
Thu, 29 Oct 2020 06:02:18 +0000 (14:02 +0800)
committerZhiting Lin <zlin035@uottawa.ca>
Thu, 29 Oct 2020 06:02:18 +0000 (14:02 +0800)
package.json
src/assets/language/en.js
src/manifest.js
src/models/transaction.js
src/views/delayTxList.vue
src/views/home.vue

index 3c3ed06..6c38cbd 100644 (file)
@@ -1,7 +1,7 @@
 {
     "name": "Byone",
     "description": "Bytom Chrome Extension Wallet",
-    "version": "3.0.6",
+    "version": "3.0.7",
     "author": "zhiting.fly@8btc.com",
     "license": "MIT",
     "private": true,
index c3f4d4b..847c0e9 100644 (file)
@@ -288,7 +288,7 @@ const en = {
     }
   },
   delayTx:{
-    title:'Scheduled Transactions',
+    title:'Scheduled Tx',
     scheduledTransfer:'Scheduled Tx',
     scheduledReceive:'Scheduled Tx',
     locked: 'Locked',
index 8f87fc2..b736e53 100644 (file)
@@ -2,7 +2,7 @@ module.exports = {
   manifest_version: 2,
   name: 'Byone',
   description: 'Bytom Wallet Chrome extension.',
-  version: '3.0.6',
+  version: '3.0.7',
   author: 'Bytom frontend, zhitinglin',
   web_accessible_resources: ['js/inject.js'],
   browser_action: {
index bc6887c..12cefd2 100644 (file)
@@ -13,13 +13,9 @@ transaction.list = function(guid, asset_id, start, limit, tx_types) {
   return bytom.transaction.list(guid, filter, null, start, limit);
 };
 
-transaction.listDelayTransaction = function(address, start, limit) {
-
-  let network = bytom.networks()
+transaction.listDelayTransaction = function(address, start, limit, network) {
   if(!network){
     network = 'mainnet'
-  }else{
-    network = network.split('vapor')[0]
   }
 
   let baseURL = networks[network]
index 2a2112c..0b7c99c 100644 (file)
@@ -97,7 +97,7 @@ font-size: 15px;
           </h1>
         </section>
 
-        <section class="transactions">
+        <section class="transactions" v-if="currentBlockHeight !== 0">
             <ul class="list">
                 <li class="list-item" v-for="(transaction, index) in transactions" :key="index" >
                     <a :href="blockmeta(transaction.lockedTxHash)" target="_blank">
@@ -248,7 +248,7 @@ export default {
       refreshTransactions: function (start, limit) {
           return new Promise((resolve, reject) => {
 
-              transaction.listDelayTransaction(this.address,  start, limit).then(transactions => {
+              transaction.listDelayTransaction(this.address,  start, limit, this.net).then(transactions => {
                 if (transactions == null) {
                       return;
                   }
@@ -300,18 +300,15 @@ export default {
         Actions.SET_LIST_VOTE
       ])
     },
-    mounted() {
+    async mounted() {
         if(this.language === 'zh' ||this.language === 'cn'){
           moment.locale('zh-cn');
         }
         else{
           moment.locale('en');
         }
-        query.blockStatus().then(resp => {
-          if(resp){
-            this.currentBlockHeight = resp.blockHeight;
-          }
-        })
+        const resp = await query.blockStatus()
+        this.currentBlockHeight = resp.blockHeight;
     },
   };
 </script>
index 239734a..7cc58b2 100644 (file)
@@ -66,7 +66,9 @@
   }
 }
 
-
+.transaction-title{
+  position:relative;
+}
 
 
 .transaction-title h3 {
@@ -257,13 +259,13 @@ input:checked + .slider:before {
     }
   .delay-btn{
     position: absolute;
-    background: rgba(255, 255, 255, 0.05);
+    background: #F5F5F5;
     border-radius: 16px 0px 0px 16px;
-    right: 0;
-    color: white;
+    right: -20px;
+    color: rgba(0, 0, 0, 0.88);
     font-size: 12px;
     padding: 4px 10px;
-    top: 20px;
+    top: 8px;
   }
   .icon_SBell{
     font-size: 16px;
@@ -312,12 +314,12 @@ input:checked + .slider:before {
                   <div>{{ $t('main.crossChain') }}</div>
                 </a>
               </div>
-              <a class="delay-btn" @click="delayOpen"><i class="iconfont icon_SBell"></i>{{ $t('delayTx.title') }}</a>
             </div>
 
         </section>
       <section v-if="address!=undefined" class="transaction-title">
-      <h3 class="color-black">{{ $t('main.asset') }}</h3>
+        <h3 class="color-black">{{ $t('main.asset') }}</h3>
+        <a class="delay-btn" @click="delayOpen"><i class="iconfont icon_SBell"></i>{{ $t('delayTx.title') }}</a>
       </section>
       <section class="assets">
         <div v-if=" balances && balances.length > 0">