OSDN Git Service

change the create page and the login in page into vues
authorZhiting Lin <zlin035@uottawa.ca>
Wed, 7 Aug 2019 07:10:22 +0000 (15:10 +0800)
committerZhiting Lin <zlin035@uottawa.ca>
Wed, 7 Aug 2019 07:10:22 +0000 (15:10 +0800)
18 files changed:
package-lock.json
package.json
src/assets/language/sdk/index.js
src/components/modal-passwd.vue
src/components/select/select.vue
src/models/account.js
src/popup.js
src/prompt.js
src/store/actions.js
src/store/constants.js
src/store/store.js
src/views/home.vue
src/views/sendTransaction/transferConfirm.vue
src/views/sideMenu/homeMenu.vue
src/views/sideMenu/menuCreation.vue
src/views/sideMenu/menuSettings.vue
src/views/transferDetail.vue
src/views/welcome/creation.vue

index ad5bd41..8de914d 100644 (file)
     "uuid": {
       "version": "3.3.2",
       "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz",
-      "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==",
-      "dev": true
+      "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA=="
     },
     "v-click-outside-x": {
       "version": "3.0.3",
index ee36a96..2cd0f00 100644 (file)
@@ -22,6 +22,7 @@
         "iview": "^3.0.0",
         "moment": "^2.22.2",
         "qrcodejs2": "0.0.2",
+        "uuid": "^3.3.2",
         "vue": "^2.5.11",
         "vue-i18n": "^8.2.1",
         "vue-loading-overlay": "^3.0.1",
index 453d3f1..313fa59 100644 (file)
@@ -4,12 +4,11 @@ const sdkLang = {
     cn: cn
 };
 
-function getLang(str) {
-    let lang = localStorage.lang;
+function getLang(str, lang) {
     if (sdkLang[lang] && sdkLang[lang][str]) {
         return sdkLang[lang][str];
     }
     return str;
 }
 
-export default getLang;
\ No newline at end of file
+export default getLang;
index 3c4a796..ce9a61b 100644 (file)
@@ -51,6 +51,8 @@
 
 <script>
 import { getLanguage } from "@/assets/language"
+import { mapGetters } from 'vuex'
+
 const CLASS_CN = "form-item-content form-item-content-cn";
 const CLASS_EN = "form-item-content form-item-content-en"
 export default {
@@ -75,10 +77,13 @@ export default {
             }
             return CLASS_CN;
         },
+        ...mapGetters([
+          'language'
+        ])
     },
     methods: {
         open() {
-            this.i18n = getLanguage();
+            this.i18n = getLanguage(this.language);
             this.show = true;
             this.passwd = "";
         },
@@ -98,4 +103,4 @@ export default {
         }
     }
 };
-</script>
\ No newline at end of file
+</script>
index 800f508..4ffa1ac 100644 (file)
@@ -38,7 +38,7 @@
     width: 12px; /* To account for extra width from rotating. */
   }
   .v-select .open-indicator:before {
-    border-color: rgb(255, 255, 255);
+    border-color: grey;
     border-style: solid;
     border-width: 3px 3px 0 0;
     content: '';
index 3cd171f..4a626ca 100644 (file)
@@ -1,4 +1,6 @@
 import bytom from './bytom'
+import uuid from 'uuid'
+
 
 let account = {
   setupNet: bytom.setupNet
@@ -6,6 +8,9 @@ let account = {
 
 account.create = function(accountAlias, keyAlias, passwd, success, error) {
   let retPromise = new Promise((resolve, reject) => {
+    if(!keyAlias){
+      keyAlias = `${accountAlias}-key-${uuid.v4()}`
+    }
     bytom.keys
       .create(keyAlias, passwd)
       .then(res => {
@@ -74,10 +79,16 @@ account.list = function() {
       .listAccountUseServer()
       .then(accounts => {
         Promise.all(accounts.map(async (account) => {
-          const balances = await this.balance(account.guid)
-          account.balances = balances
+          try{
+            const balances = await this.balance(account.guid)
+            account.balances = balances
+          }catch (e) {
+            return e
+          }
         })).then(()=>{
           resolve(accounts)
+        }).catch(error=>{
+          throw error
         })
       })
       .catch(error => {
index c6d2a70..f9d6c0c 100644 (file)
@@ -17,48 +17,48 @@ import '@/assets/style.css'
 import {store} from "./store/store";
 import * as Actions from "./store/constants";
 
-Vue.use(VueI18n)
-const i18n = new VueI18n({
-  fallbackLocale: 'en',
-  locale: getLanguage(),
-  messages
-})
-Vue.use(i18n)
-Vue.use(vuescroll)
-Vue.use(VueRouter)
-Vue.use(MenuPage)
-Vue.use(Loading)
-Vue.use(Dialog, i18n)
-Vue.component('v-select', vSelect)
 
-Vue.prototype.$vuescrollConfig = {
-  mode: 'pure-native',
-  bar: {
-    keepShow: true,
-    background: '#c9c9c9'
+store.dispatch(Actions.LOAD_BYTOM).then(() => {
+  Vue.use(VueI18n)
+  const i18n = new VueI18n({
+    fallbackLocale: 'en',
+    locale: getLanguage(store.getters.language),
+    messages
+  })
+  Vue.use(i18n)
+  Vue.use(vuescroll)
+  Vue.use(VueRouter)
+  Vue.use(MenuPage)
+  Vue.use(Loading)
+  Vue.use(Dialog, i18n)
+  Vue.component('v-select', vSelect)
+
+  Vue.prototype.$vuescrollConfig = {
+    mode: 'pure-native',
+    bar: {
+      keepShow: true,
+      background: '#c9c9c9'
+    }
   }
-}
 
-Vue.filter('moment', function(value, formatString) {
-  formatString = formatString || 'YYYY-MM-DD HH:mm:ss'
-  return moment(value * 1000).format(formatString)
-})
+  Vue.filter('moment', function(value, formatString) {
+    formatString = formatString || 'YYYY-MM-DD HH:mm:ss'
+    return moment(value * 1000).format(formatString)
+  })
 
-const RouterConfig = {
-  routes: Routers
-}
-const router = new VueRouter(RouterConfig)
-router.beforeEach((to, from, next) => {
-  // wallet init
-  if (localStorage.login == undefined && to.name == 'home') {
-    next({ name: 'welcome-creation' })
-    return
+  const RouterConfig = {
+    routes: Routers
   }
+  const router = new VueRouter(RouterConfig)
+  router.beforeEach((to, from, next) => {
+    // wallet init
+    if (store.getters.login == undefined && to.name == 'home') {
+      next({ name: 'welcome-creation' })
+      return
+    }
 
-  next()
-})
-
-store.dispatch(Actions.LOAD_BYTOM).then(() => {
+    next()
+  })
   new Vue({
     el: '#app',
     i18n: i18n,
index c4cca6b..0965b2b 100644 (file)
@@ -16,36 +16,36 @@ import vSelect from '@/components/select'
 import messages, { getLanguage } from '@/assets/language'
 import '@/assets/style.css'
 
-Vue.use(VueI18n)
-const i18n = new VueI18n({
-  fallbackLocale: 'en',
-  locale: getLanguage(),
-  messages
-})
-Vue.use(i18n)
-Vue.use(vuescroll)
-Vue.use(VueRouter)
-Vue.use(Loading)
-Vue.use(Dialog, i18n)
-Vue.component('v-select', vSelect)
-Vue.filter('moment', function(value, formatString) {
-  formatString = formatString || 'YYYY-MM-DD HH:mm:ss'
-  return moment(value * 1000).format(formatString)
-})
-Vue.prototype.$vuescrollConfig = {
-  mode: 'pure-native',
-  bar: {
-    keepShow: true,
-    background: '#c9c9c9'
-  }
-}
-
-const RouterConfig = {
-  routes: Routers
-}
-const router = new VueRouter(RouterConfig)
 
 store.dispatch(Actions.LOAD_BYTOM).then(() => {
+  Vue.use(VueI18n)
+  const i18n = new VueI18n({
+    fallbackLocale: 'en',
+    locale: getLanguage(store.getters.language),
+    messages
+  })
+  Vue.use(i18n)
+  Vue.use(vuescroll)
+  Vue.use(VueRouter)
+  Vue.use(Loading)
+  Vue.use(Dialog, i18n)
+  Vue.component('v-select', vSelect)
+  Vue.filter('moment', function(value, formatString) {
+    formatString = formatString || 'YYYY-MM-DD HH:mm:ss'
+    return moment(value * 1000).format(formatString)
+  })
+  Vue.prototype.$vuescrollConfig = {
+    mode: 'pure-native',
+    bar: {
+      keepShow: true,
+      background: '#c9c9c9'
+    }
+  }
+
+  const RouterConfig = {
+    routes: Routers
+  }
+  const router = new VueRouter(RouterConfig)
   new Vue({
     el: '#app',
     i18n: i18n,
index 398248f..9854555 100644 (file)
@@ -2,6 +2,7 @@ import * as Actions from './constants'
 import Bytom from '../utils/Bytom'
 import InternalMessage from '../messages/internal'
 import * as InternalMessageTypes from '../messages/types'
+import account from "../models/account";
 
 export const actions = {
     [Actions.SET_BYTOM]:({commit}, bytom) => commit(Actions.SET_BYTOM, bytom),
@@ -24,38 +25,62 @@ export const actions = {
         })
     },
 
-    // [Actions.IMPORT_BYTOM]:({dispatch}, {imported, seed}) => {
-    //     return new Promise(async (resolve, reject) => {
-    //
-    //         const bytom = Bytom.fromJson(imported);
-    //
-    //         await Promise.all(PluginRepository.signatureProviders().map(async plugin => {
-    //             const network = await plugin.getEndorsedNetwork();
-    //
-    //             bytom.settings.networks = bytom.settings.networks.filter(_network => _network.unique() !== network.unique());
-    //             bytom.settings.networks.push(network);
-    //         }));
-    //
-    //         bytom.meta = new Meta();
-    //
-    //         InternalMessage.payload(InternalMessageTypes.SET_SEED, seed).send().then(() => {
-    //             dispatch(Actions.UPDATE_STORED_BYTOM, bytom).then(_bytom => {
-    //                 resolve();
-    //             })
-    //         });
-    //     })
-    // },
+    [Actions.IMPORT_BYTOM]:({state, commit, dispatch}) => {
+        return new Promise(async (resolve, reject) => {
+            const bytom = Bytom.fromJson(state.bytom);
+            bytom.settings.network = 'mainnet';
+            account.setupNet('mainnet')
+            account.list().then(accounts => {
+                bytom.accountList = accounts;
+                if (accounts.length > 0) {
+                    bytom.currentAccount = accounts[0];
+                }
+
+                bytom.settings.login = true
+                dispatch(Actions.UPDATE_STORED_BYTOM, bytom).then(_bytom => {
+                    dispatch(Actions.SET_BYTOM, Bytom.fromJson(_bytom));
+                    resolve();
+                })
+            })
 
-    [Actions.CREATE_NEW_BYTOM]:({state, commit, dispatch}, network, currentAccount) => {
+        })
+    },
+
+    [Actions.CREATE_NEW_BYTOM]:({state, commit, dispatch}, network) => {
         return new Promise(async (resolve, reject) => {
             const bytom = Bytom.fromJson(state.bytom);
             bytom.settings.network = network;
-            bytom.currentAccount = currentAccount
+            account.setupNet(network)
+            account.list().then(accounts => {
+              bytom.accountList = accounts;
+              if (accounts.length > 0) {
+                bytom.currentAccount = accounts[0];
+              }
 
-            dispatch(Actions.UPDATE_STORED_BYTOM, bytom).then(_bytom => {
-                dispatch(Actions.SET_BYTOM, Bytom.fromJson(_bytom));
-                resolve();
+              bytom.settings.login = true
+              dispatch(Actions.UPDATE_STORED_BYTOM, bytom).then(_bytom => {
+                  dispatch(Actions.SET_BYTOM, Bytom.fromJson(_bytom));
+                  resolve();
+              })
+            })
+
+        })
+    },
+
+  [Actions.CREATE_NEW_BYTOM_ACCOUNT]:({state, commit, dispatch}, currentAccount) => {
+        return new Promise(async (resolve, reject) => {
+            const bytom = Bytom.fromJson(state.bytom);
+            account.setupNet(bytom.settings.network)
+            account.list().then(accounts => {
+              bytom.accountList = accounts;
+              bytom.currentAccount = currentAccount;
+
+              dispatch(Actions.UPDATE_STORED_BYTOM, bytom).then(_bytom => {
+                  dispatch(Actions.SET_BYTOM, Bytom.fromJson(_bytom));
+                  resolve();
+              })
             })
+
         })
     },
 
index 2dc056b..1e1ea93 100644 (file)
@@ -4,6 +4,7 @@ export const SET_BYTOM = 'setBytom';
 export const IS_UNLOCKED = 'isUnlocked';
 export const UPDATE_STORED_BYTOM = 'updateStoredBytom';
 export const CREATE_NEW_BYTOM = 'createNewBytom';
+export const CREATE_NEW_BYTOM_ACCOUNT = 'createNewAccount';
 export const IMPORT_BYTOM = 'importBytom';
 export const SET_AUTO_LOCK = 'setAutoLock';
 export const LOCK = 'lock';
index f9e3be1..97e1806 100644 (file)
@@ -20,6 +20,7 @@ const getters = {
     accountList:state => state.bytom.accountList,
     net:state => state.bytom.settings.network,
     language:state => state.bytom.settings.language,
+    login:state => state.bytom.settings.login,
 
     // FOR PROMPTS ONLY
     messages:state => state.prompt.data.messages || [],
index 2e81bc0..0d4e7d9 100644 (file)
@@ -317,7 +317,7 @@ export default {
         accountBalance: function () {
             let balance
             const balances = this.currentAccount.balances
-            if(balances.length >0 ){
+            if(balances && balances.length >0 ){
                 const balanceObject = balances.filter(b => b.asset === BTM)[0]
                 balance = balanceObject.balance/Math.pow(10,balanceObject.decimals)
             }
index a6477ba..0d69097 100644 (file)
@@ -158,6 +158,7 @@ import transaction from "@/models/transaction";
 import modalPasswd from "@/components/modal-passwd";
 import getLang from "@/assets/language/sdk";
 import { LocalStream } from 'extension-streams';
+import { mapGetters } from 'vuex'
 
 export default {
     components: {
@@ -176,6 +177,11 @@ export default {
             password:''
         };
     },
+    computed: {
+      ...mapGetters([
+        'language'
+      ])
+    },
     methods: {
         transfer: function () {
             if (this.password == "") {
@@ -208,7 +214,7 @@ export default {
                 .catch(error => {
                     loader.hide();
                     this.$dialog.show({
-                        body: getLang(error.message)
+                        body: getLang(error.message, this.language)
                     });
                 });
         }
index 5104209..5450479 100644 (file)
           }
         },
         calculateBalance: function (balances) {
-          if( balances.length>0 ){
+          if(balances && balances.length>0 ){
             const balanceObject = balances.filter(b => b.asset === BTM)[0]
             const balance = balanceObject.balance/Math.pow(10,balanceObject.decimals)
             return balance
index 2c67f37..2091094 100644 (file)
                     <input type="text" v-model="formItem.accAlias">
                 </div>
             </div>
-            <div class="form-item">
-                <label class="form-item-label">{{ $t('createAccount.keyAlias') }}</label>
-                <div class="form-item-content">
-                    <input type="text" v-model="formItem.keyAlias">
-                </div>
-            </div>
+
             <div class="form-item">
                 <label class="form-item-label">{{ $t('createAccount.keyPassword') }}</label>
                 <div class="form-item-content">
@@ -57,6 +52,9 @@
 
 <script>
 import account from "@/models/account";
+import * as Actions from '@/store/constants';
+import { mapActions, mapState } from 'vuex'
+
 export default {
     name: "",
     components: {},
@@ -71,6 +69,11 @@ export default {
             tips: ""
         };
     },
+    computed: {
+      ...mapState([
+        'bytom'
+      ]),
+    },
     methods: {
         create: function () {
             if (this.formItem.accAlias == "") {
@@ -79,12 +82,7 @@ export default {
                 });
                 return;
             }
-            if (this.formItem.keyAlias == "") {
-                this.$dialog.show({
-                    body: this.$t("createAccount.inputKey")
-                });
-                return;
-            }
+
             if (this.formItem.passwd1 == "") {
                 this.$dialog.show({
                     body: this.$t("createAccount.inputPass")
@@ -104,10 +102,12 @@ export default {
                 onCancel: this.onCancel
             });
 
-            account.create(this.formItem.accAlias, this.formItem.keyAlias, this.formItem.passwd1).then(res => {
+            account.create(this.formItem.accAlias, null, this.formItem.passwd1).then(account => {
+              this[Actions.CREATE_NEW_BYTOM_ACCOUNT](account).then(()=>{
                 loader.hide();
-                console.log("bytom.Account.create", res);
-                this.$router.push({ name: "home", params: { selectedAccount: res } });
+                this.$router.push('/');
+              })
+
             }).catch(err => {
                 console.log(err);
                 loader.hide();
@@ -115,7 +115,10 @@ export default {
                     body: err.message
                 });
             });
-        }
+        },
+        ...mapActions([
+          Actions.CREATE_NEW_BYTOM_ACCOUNT,
+        ])
     },
     mounted() { }
 };
index 5841b6f..bde7790 100644 (file)
@@ -106,14 +106,17 @@ export default {
             account.setupNet(val.value);
 
             bytom.currentAccount = {}
-            account.list().then(accounts => {
-              bytom.accountList = accounts;
-              if (accounts.length > 0) {
-                bytom.currentAccount = accounts[0];
-              }
+            account.list()
+              .then(accounts => {
 
-              this[Actions.UPDATE_STORED_BYTOM](bytom)
-            }).catch(errors=>{
+                bytom.accountList = accounts;
+                if (accounts.length > 0) {
+                  bytom.currentAccount = accounts[0];
+                }
+
+                this[Actions.UPDATE_STORED_BYTOM](bytom)
+              })
+              .catch((errors) =>{
               bytom.accountList =[]
               this[Actions.UPDATE_STORED_BYTOM](bytom)
             })
index 80a5485..0b0a87d 100644 (file)
                       <tr>
                         <td colspan="2"><div class="divider"></div></td>
                       </tr>
-                      <tr :key="index" v-for="(input, index) in transaction.inputs">
+                      <tr :key="'input'+index" v-for="(input, index) in transaction.inputs">
                         <td class="label">{{ $t('transactionDetail.sendAddress') }}{{transaction.inputs.length > 1 ? index+1 : ''}}</td>
                         <td class="value">{{input.address}}<span v-if="input.address == selfAddress"> {{ $t('transactionDetail.myAddress') }}</span></td>
                       </tr>
-                      <tr :key="index" v-for="(output, index) in transaction.outputs">
+                      <tr :key="'output'+ index" v-for="(output, index) in transaction.outputs">
                         <td class="label">{{ $t('transactionDetail.receiveAddress') }}{{transaction.outputs.length > 1 ? index+1 : ''}}</td>
                         <td class="value">{{output.address}}<span v-if="output.address == selfAddress"> {{ $t('transactionDetail.myAddress') }}</span></td>
                       </tr>
index e432a52..150a01f 100644 (file)
 /*}*/
 
   .v-select{
-    height: 28px;
-    width: 160px;
-    background: white;
-    border-radius: 15px;
+    height: 32px;
+    width: 100%;
+    background: rgba(247,247,247,1);
     font-size: 14px;
     margin: auto;
-    padding-left: 20px;
+    border-bottom: 1px solid #E0E0E0;
+    /*padding-left: 20px;*/
   }
 
   .tabs{
       <div class="bg-image">
       </div>
       <div class="topbar">
-        <div v-if="activeTab === 'register'" class="topbar-middle">
-          <v-select  class="v-select" v-bind:colorBlack="true" :clearable="false" v-model="selected" :options="nets"></v-select>
-        </div>
+        <!--<div v-if="activeTab === 'register'" class="topbar-middle">-->
+          <!--<v-select  class="v-select" v-bind:colorBlack="true" :clearable="false" v-model="selected" :options="nets"></v-select>-->
+        <!--</div>-->
         <a href="http://github.com/bycoinio/Bystore" target="_blank"><i class="iconfont icon-github"></i></a>
       </div>
       <div class="header">
           <div  v-if="activeTab === 'register'" >
             <div class="form panel">
                 <div class="form-item">
-                    <label :class="formItemLabel">{{ $t('createAccount.accountAlias') }}</label>
+                    <label :class="formItemLabel">network</label>
                     <div :class="formItemContent">
-                        <input type="text" v-model="formItem.accAlias" autofocus>
+                      <v-select  class="v-select" v-bind:colorBlack="true" :clearable="false" v-model="selected" :options="nets"></v-select>
                     </div>
                 </div>
-                <div class="form-item">
-                    <label :class="formItemLabel">{{ $t('createAccount.keyAlias') }}</label>
+              <div class="form-item">
+                    <label :class="formItemLabel">{{ $t('createAccount.accountAlias') }}</label>
                     <div :class="formItemContent">
-                        <input type="text" v-model="formItem.keyAlias">
+                        <input type="text" v-model="formItem.accAlias" autofocus>
                     </div>
                 </div>
+                <!--<div class="form-item">-->
+                    <!--<label :class="formItemLabel">{{ $t('createAccount.keyAlias') }}</label>-->
+                    <!--<div :class="formItemContent">-->
+                        <!--<input type="text" v-model="formItem.keyAlias">-->
+                    <!--</div>-->
+                <!--</div>-->
                 <div class="form-item">
                     <label :class="formItemLabel">{{ $t('createAccount.keyPassword') }}</label>
                     <div :class="formItemContent">
@@ -193,6 +199,7 @@ import account from "../../models/account";
 import { getLanguage } from '@/assets/language'
 import getLang from "../../assets/language/sdk";
 import { mapActions, mapGetters, mapState } from 'vuex'
+import * as Actions from '@/store/constants';
 
 let mainNet = null;
 let testNet = null;
@@ -206,7 +213,7 @@ export default {
             selected: mainNet,
             formItem: {
                 accAlias: "",
-                keyAlias: "",
+                // keyAlias: "",
                 passwd1: "",
                 passwd2: "",
                 checked: false
@@ -257,12 +264,6 @@ export default {
                 });
                 return;
             }
-            if (this.formItem.keyAlias == "") {
-                this.$dialog.show({
-                    body: this.$t("createAccount.inputKey")
-                });
-                return;
-            }
             if (this.formItem.passwd1 == "") {
                 this.$dialog.show({
                     body: this.$t("createAccount.inputPass")
@@ -286,11 +287,13 @@ export default {
                 canCancel: true,
                 onCancel: this.onCancel
             });
-            account.create(this.formItem.accAlias, this.formItem.keyAlias, this.formItem.passwd1).then(res => {
-                localStorage.login = true;
+            account.create(this.formItem.accAlias, null, this.formItem.passwd1).then(currentAccount => {
+                // localStorage.login = true;
+              this[Actions.CREATE_NEW_BYTOM](this.selected.value).then(() =>{
                 loader.hide();
                 this.formItem = {};
                 this.$router.push('/');
+              });
             }).catch(err => {
                 loader.hide();
                 this.$dialog.show({
@@ -315,18 +318,23 @@ export default {
             return;
           }
           account.restore(this.restore.fileTxt).then(res => {
-            localStorage.login = true;
-            this.$router.push('/');
+            // localStorage.login = true;
+            this[Actions.IMPORT_BYTOM]().then(() =>{
+              this.$router.push('/');
+            });
           }).catch(error => {
             this.$dialog.show({
-              body: getLang(error.message)
+              body: getLang(error.message, this.language)
             });
           });
-        }
+        },
+        ...mapActions([
+          Actions.CREATE_NEW_BYTOM,
+          Actions.IMPORT_BYTOM,
+        ])
     },
     watch: {
         selected: function (value) {
-            localStorage.bytomNet = value.value;
             account.setupNet(value.value);
         }
     },
@@ -334,8 +342,8 @@ export default {
         mainNet = { label: this.$t('main.mainNet'), value: "mainnet" };
         testNet = { label: this.$t('main.testNet'), value: "testnet" };
         soloNet = { label: this.$t('main.soloNet'), value: "solonet" };
-        vaporTestnet = { label: this.$t('main.vaporTestnet'), value: "vaporTestnet" };
-        this.nets = [mainNet, testNet,vaporTestnet];
+        // vaporTestnet = { label: this.$t('main.vaporTestnet'), value: "vaporTestnet" };
+        this.nets = [mainNet, testNet,soloNet];
         if (this.net != undefined) {
             if (this.net == "mainnet") {
                 this.selected = mainNet;
@@ -343,9 +351,11 @@ export default {
                 this.selected = testNet;
             } else if (this.net == "solonet") {
                 this.selected = soloNet;
-            } else if (this.net == "vaporTestnet") {
-                this.selected = vaporTestnet;
             }
+
+            // else if (this.net == "vaporTestnet") {
+            //     this.selected = vaporTestnet;
+            // }
         } else {
             this.selected = mainNet;
         }