Skip to content

Commit

Permalink
Merge pull request #51 from GetScatter/master
Browse files Browse the repository at this point in the history
FIO Fixes, Account hint fixes, missing explorer fixes
  • Loading branch information
nsjames authored Aug 4, 2020
2 parents b48452e + 3087114 commit 083b74d
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 27 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "bridge",
"version": "1.0.10",
"version": "1.0.11",
"private": true,
"scripts": {
"build": "npm run check && yarn && cross-env NODE_ENV=production BABEL_ENV=prod vue-cli-service build && npm run zip",
Expand All @@ -22,7 +22,7 @@
"@walletpack/core": "^1.0.50",
"@walletpack/eosio": "^0.0.61",
"@walletpack/ethereum": "^0.0.59",
"@walletpack/fio": "^0.0.27",
"@walletpack/fio": "^0.0.28",
"@walletpack/tron": "^0.0.62",
"aes-oop": "^1.0.4",
"bip32": "^2.0.4",
Expand Down
23 changes: 19 additions & 4 deletions src/components/ManageAccounts.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,15 @@
</section>
<section class="accounts">
<section class="account" v-for="account in accounts" v-if="search.length || expanded[network.unique()] || enabledAccounts.find(x => x.unique() === account.unique())">
<figure class="account-name">{{account.sendable()}}<span class="authority" v-if="account.authority">@{{account.authority}}</span></figure>
<figure class="account-name" v-if="network.blockchain === 'fio'">
<span v-if="account.fio_address">{{account.fio_address}}</span>
<span v-else>{{account.sendable()}}<span class="authority">@{{account.authority}}</span></span>

</figure>
<figure class="account-name" v-else>
{{account.sendable()}}<span class="authority" v-if="account.authority">@{{account.authority}}</span>
</figure>

<figure class="select-account" :class="{'selected':enabledAccounts.find(x => x.unique() === account.unique())}" @click="select(account, network)">
<i class="fa fa-check"></i>
</figure>
Expand Down Expand Up @@ -112,11 +120,18 @@
|| x.authority.toLowerCase().indexOf(this.search) > -1
|| network.name.toLowerCase().indexOf(this.search) > -1;
});
})()
})().reduce((acc,x) => {
if(x.fio_address) {
if(!acc.find(y => y.fio_address === x.fio_address)) acc.push(x);
}
else acc.push(x);
return acc;
}, [])
.sort((a,b) => {
return a.sendable().localeCompare(b.sendable())
})
// .sort((a,b) => {
// return a.sendable().localeCompare(b.sendable())
// }).sort((a,b) => {
// return this.enabledAccounts.find(x => x.unique() === a.unique()) ? -1 : 0;
// })
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/wallet/Assets.vue
Original file line number Diff line number Diff line change
Expand Up @@ -296,10 +296,10 @@
this.loadChart()
});
// TODO: Not showing savings
if(this.savingsEnabled) {
this.scatter.settings.networks.map(network => {
if (network.blockchain === 'eos') this.lockableChains[network.unique()] = true;
if (network.blockchain === 'fio') this.lockableChains[network.unique()] = true;
// this.lockableChains[network.unique()] = PluginRepository.plugin(network.blockchain).hasAccountActions();
})
Expand Down
2 changes: 1 addition & 1 deletion src/components/wallet/History.vue
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@
if(typeof hist.account === 'string') return hist.account.slice(24, -1).split(':')[0];
return hist.account.blockchain();
})();
const explorers = this.scatter.settings.explorers || PluginRepository.defaultExplorers();
const explorers = PluginRepository.defaultExplorers();
const explorer = explorers[blockchain].parsed();
this.openInBrowser(explorer.transaction(hist.txid));
},
Expand Down
2 changes: 1 addition & 1 deletion src/store/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ export const getters = {

identity:state => state.scatter.keychain.identities[0],

explorers:state => state.scatter.settings.explorers || PluginRepository.defaultExplorers(),
explorers:state => PluginRepository.defaultExplorers(),
avatars:state => state.scatter.keychain.avatars || {},
friends:state => state.scatter.friends || [],
};
Expand Down
22 changes: 4 additions & 18 deletions src/views/popouts/AppLogin.vue
Original file line number Diff line number Diff line change
Expand Up @@ -76,27 +76,13 @@
this.selectedAccount = this.accounts[0];
if(this.hintAccount){
const plugin = PluginRepository.plugin('eos');
let [account_name, account_permission] = this.hintAccount.split('@');
// Never allowing owner
if(!account_permission || account_permission.trim().toLowerCase() === 'owner') account_permission = 'active';
const accountData = await plugin.accountData(null, this.requestedNetworks[0], account_name);
if(!accountData) this.closer(null);
const keys = accountData.permissions.filter(x => x.perm_name !== 'owner').reduce((acc, x) => {
x.required_auth.keys.map(({key}) => acc.push(key));
return acc;
}, []);
const found = this.scatter.keychain.keypairs.find(x => keys.includes(x.publicKeys.find(k => k.blockchain === 'eos').key));
if(found){
this.selectedAccount = Account.fromJson({
keypairUnique:found.unique(),
networkUnique:this.requestedNetworks[0].unique(),
publicKey:found.publicKeys.find(x => x.blockchain === 'eos').key,
name:account_name,
authority:account_permission,
fromOrigin:this.app.applink
});
}
const exists = this.scatter.keychain.accounts.find(x => x.name === account_name && x.authority === account_permission);
if(exists) this.selectedAccount = exists;
}
},
methods:{
Expand Down

0 comments on commit 083b74d

Please sign in to comment.