OSDN Git Service

update delete wallet message with password
authorZhiting Lin <zlin035@uottawa.ca>
Mon, 31 Aug 2020 02:31:55 +0000 (10:31 +0800)
committerZhiting Lin <zlin035@uottawa.ca>
Mon, 31 Aug 2020 02:31:55 +0000 (10:31 +0800)
build/webpack.base.conf.js
package.json
src/assets/language/cn.js
src/assets/language/en.js
src/components/modal-passwd.vue
src/manifest.js
src/models/account.js
src/views/settings/deleteWallet.vue
updates.xml

index 7f17868..0a77fa9 100644 (file)
@@ -104,7 +104,7 @@ module.exports = {
       chunks: ['options']
     }),
     page({
-      title: 'Byone notification',
+      title: 'Byone',
       name: 'prompt',
       chunks: ['prompt']
     }),
index 432c7c7..0dee7df 100644 (file)
@@ -1,7 +1,7 @@
 {
     "name": "Byone",
     "description": "Bytom Chrome Extension Wallet",
-    "version": "3.0.0",
+    "version": "3.0.1",
     "author": "zhiting.fly@8btc.com",
     "license": "MIT",
     "private": true,
index f1a55fb..abbf054 100644 (file)
@@ -253,7 +253,7 @@ const cn = {
     BTM0004:'请输入Keystore。',
     BTM0005:'输入数量大于可用余额。',
     BTM0006:'输入有效的地址格式。',
-    BTM0007:'é\92±å\8c\85å\90\8d称é\94\99误ï¼\8c请è¾\93å\85¥æ­£ç¡®é\92±å\8c\85å\90\8d称。',
+    BTM0007:'é\92±å\8c\85å¯\86ç \81é\94\99误ï¼\8c请è¾\93å\85¥æ­£ç¡®é\92±å\8c\85å¯\86ç \81。',
     BTM0008:'密码不能为空',
     BTM0009:'目前钱包已为账户',
     BTM0010:'Keystore导入不支持V2多账户导入,请拆分为单个Keystore',
index 7a5601e..e9a476f 100644 (file)
@@ -248,7 +248,7 @@ const en = {
     BTM0004:'Please enter Keystore.',
     BTM0005:'Insufficient balance.',
     BTM0006:'Address format error',
-    BTM0007:'Wallet name error',
+    BTM0007:'Wallet password is wrong, please enter the correct password.',
     BTM0008:'Empty password',
     BTM0009:'Current wallet is already an account',
     BTM0010:'Keystore restore dose not support V2 multiple account. Please split into single keystore.',
index df06b4c..8e4e18a 100644 (file)
@@ -13,7 +13,8 @@
     z-index: 4;
     margin: auto;
     top: 0;
-    height: 131px;
+    min-height: 131px;
+    height: fit-content;
     border-radius: 8px;
 }
 
 <template>
     <div>
         <section v-show="show" class="mask"></section>
-        <transition name="page-transfer" <!-- enter-active-class="animated slideInUp faster" leave-active-class="animated slideOutDown faster"> -->
+        <transition name="page-transfer" >
             <div v-show="show" class="confirm form bg-white">
+                <div v-if="label" class="form-item">
+                    <div class="form-item-content">
+                        <span class="color-black font-bold">{{ label }}</span>
+                    </div>
+                </div>
                 <div class="form-item">
                     <div class="form-item-content">
-                        <input v-if="text_placeholder" type="text" v-model="passwd" :placeholder="text_placeholder" autofocus>
-                        <input v-else type="password" v-model="passwd" :placeholder="$t('transfer.password')" autofocus>
+                        <input type="password" v-model="passwd" :placeholder="$t('transfer.password')" autofocus>
                     </div>
                 </div>
                 <div class="btn-group btn-inline">
@@ -59,10 +64,7 @@ export default {
         };
     },
     props: {
-        text_placeholder:{
-            type: String,
-        },
-        text_error_hint:{
+        label:{
             type: String,
         },
         i18n: {
@@ -88,7 +90,7 @@ export default {
         confirm() {
             if (this.passwd == "") {
                 this.$toast.error(
-                    this.text_error_hint || this.$t("transfer.emptyPassword")
+                    this.$t("transfer.emptyPassword")
                 );
                 return;
             }
index 7384ca3..73b2dd3 100644 (file)
@@ -2,7 +2,7 @@ module.exports = {
   manifest_version: 2,
   name: 'Byone',
   description: 'Bytom Wallet Chrome extension.',
-  version: '3.0.0',
+  version: '3.0.1',
   author: 'Bytom frontend, zhitinglin',
   web_accessible_resources: ['js/inject.js', 'wasm/main.wasm'],
   browser_action: {
index b2c50de..f903ca0 100644 (file)
@@ -338,4 +338,9 @@ account.createOld = function(accountAlias, keyAlias, passwd, success, error) {
   })
   return retPromise
 }
+
+account.isValidPassword = function(keystore, password){
+  return bytom.keys.verifyPassword(keystore, password)
+}
+
 export default account
index 11856a2..dbe5e55 100644 (file)
           </div>
         </section>
 
-        <modal-passwd ref="confirmModal" @confirm="deleteW" :text_placeholder="$t('setting.deleteConfirmHint')" :text_error_hint="$t('setting.emptyWallet')"></modal-passwd>
+        <modal-passwd ref="confirmModal" @confirm="deleteW" :label="walletName" ></modal-passwd>
     </div>
 </template>
 
 <script>
 import { mapActions, mapGetters, mapState } from 'vuex'
 import * as Actions from '@/store/constants';
+import account from "@/models/account";
 
 export default {
     name: "",
@@ -64,6 +65,11 @@ export default {
         };
     },
     computed: {
+      walletName(){
+        if(this.currentAccount){
+          return this.currentAccount.alias
+        }
+      },
       ...mapState([
         'bytom',
       ]),
@@ -72,10 +78,10 @@ export default {
       ])
     },
     methods: {
-      deleteW(alias){
-        if(this.currentAccount.alias === alias){
+      deleteW(password){
+        if(account.isValidPassword(this.currentAccount.keystore, password)){
           const bytom = this.bytom.clone();
-          bytom.keychain.removeByAlias(alias);
+          bytom.keychain.removeByAlias(this.currentAccount.alias);
           const values = Object.values(bytom.keychain.pairs)
 
           if(values.length === 0){
index 50d60d8..d3f7f8a 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version='1.0' encoding='UTF-8'?>
 <gupdate xmlns='http://www.google.com/update2/response' protocol='2.0'>
   <app appid='gnooapainaenaagmljnopepbheiaaaok'>
-    <updatecheck codebase='http://localhost:8000/chrome-ext.crx' version='3.0.0' prodversionmin='64.0.3242' />
+    <updatecheck codebase='http://localhost:8000/chrome-ext.crx' version='3.0.1' prodversionmin='64.0.3242' />
   </app>
 </gupdate>
\ No newline at end of file