Skip to content

Commit 0b7211e

Browse files
authored
Merge pull request #27 from GetScatter/master
Production
2 parents 0b5d35b + 3009cab commit 0b7211e

File tree

11 files changed

+50
-54
lines changed

11 files changed

+50
-54
lines changed

dist/main.bundle.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/panels/settings/SettingsGeneral.vue

+18-5
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,11 @@
5959

6060
<p>{{$t('settings.general.testingModeDescription')}}</p>
6161

62-
<Button :text="$t('settings.general.testingModeButton')" @click.native="openInBrowser('https://t.me/ScatterTesters')" />
63-
<br>
64-
<br>
62+
<section v-if="!testingMode">
63+
<Button :text="$t('settings.general.testingModeButton')" @click.native="openInBrowser('https://t.me/ScatterTesters')" />
64+
<br>
65+
<br>
66+
</section>
6567

6668
<Switcher :state="testingMode" v-on:switched="toggleTestingMode" />
6769
</section>
@@ -85,6 +87,7 @@
8587
import Injectable from "../../../services/wallets/Injectable";
8688
import {Popup} from "../../../models/popups/Popup";
8789
import PopupService from "../../../services/utility/PopupService";
90+
import SocketService from "@walletpack/core/services/utility/SocketService";
8891
8992
export default {
9093
data () {return {
@@ -118,12 +121,22 @@
118121
},
119122
methods: {
120123
async toggleTestingMode(){
124+
125+
const setMode = async bool => {
126+
await this[UIActions.SET_TESTING_MODE](bool);
127+
await SocketService.close();
128+
setTimeout(async () => {
129+
await window.wallet.lock();
130+
window.wallet.utility.reload();
131+
}, 500);
132+
};
133+
121134
if(!this.testingMode){
122135
PopupService.push(Popup.verifyPassword(pass => {
123-
if(pass === 'i_am_testing') this[UIActions.SET_TESTING_MODE](true);
136+
if(pass === 'i_am_testing') setMode(true);
124137
else PopupService.push(Popup.snackbar("You must get the password from the testing group!"))
125138
}, true))
126-
} else this[UIActions.SET_TESTING_MODE](false);
139+
} else setMode(false);
127140
},
128141
async enableSimpleMode(){
129142
PopupService.push(Popup.enableSimpleMode(async enabled => {

src/components/popins/overlay/EnableSimpleMode.vue

+1-36
Original file line numberDiff line numberDiff line change
@@ -38,41 +38,6 @@
3838

3939

4040

41-
<section class="boxes" v-for="(account, networkUnique) in accounts">
42-
<section class="box-container" style="width:100%;">
43-
<label>{{accountNetwork(networkUnique).name}}</label>
44-
<section class="box nested account-selector flex" @click="replaceAccount(account)">
45-
<section class="symbol">
46-
<TokenSymbol :token="accountNetwork(networkUnique).systemToken()" />
47-
</section>
48-
<section>
49-
<figure class="name">{{sendable(account)}}</figure>
50-
</section>
51-
<figure class="chevron fas fa-caret-square-down"></figure>
52-
</section>
53-
</section>
54-
</section>
55-
56-
57-
58-
59-
<section class="boxes" v-for="(account, networkUnique) in accounts">
60-
<section class="box-container" style="width:100%;">
61-
<label>{{accountNetwork(networkUnique).name}}</label>
62-
<section class="box nested account-selector flex" @click="replaceAccount(account)">
63-
<section class="symbol">
64-
<TokenSymbol :token="accountNetwork(networkUnique).systemToken()" />
65-
</section>
66-
<section>
67-
<figure class="name">{{sendable(account)}}</figure>
68-
</section>
69-
<figure class="chevron fas fa-caret-square-down"></figure>
70-
</section>
71-
</section>
72-
</section>
73-
74-
75-
7641

7742
</section>
7843
</section>
@@ -147,7 +112,7 @@
147112
};
148113
149114
const defaultAccounts = this.defaultKeyAccounts(key, network);
150-
if(defaultAccounts.length){
115+
if(defaultAccounts && defaultAccounts.length){
151116
this.accounts[network.unique()] = defaultAccounts[0].clone();
152117
}
153118
})

src/components/tokens/TokenList.vue

+5-3
Original file line numberDiff line numberDiff line change
@@ -63,11 +63,13 @@
6363
pageLength:20,
6464
}},
6565
mounted(){
66-
elem = document.getElementById('assets');
67-
elem.addEventListener('scroll', this.handleScroll);
66+
setTimeout(() => {
67+
elem = document.getElementById('assets');
68+
if(elem) elem.addEventListener('scroll', this.handleScroll);
69+
}, 200);
6870
},
6971
destroyed(){
70-
elem.removeEventListener('scroll', this.handleScroll);
72+
if(elem) elem.removeEventListener('scroll', this.handleScroll);
7173
},
7274
computed:{
7375
...mapState([

src/migrations/11.0.0.js

+6-4
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@ export const m11_0_0 = async scatter => {
1515
await Promise.all(keypairs.map(async keypair => {
1616
delete keypair.keyHash;
1717

18-
await KeyPairService.addPublicKey(keypair, Blockchains.BTC, true);
18+
keypair.privateKey = await window.wallet.decrypt(keypair.privateKey);
19+
if(typeof keypair.privateKey === 'object' && keypair.privateKey.hasOwnProperty('data')) keypair.privateKey = keypair.privateKey.data;
20+
await KeyPairService.addPublicKey(keypair, Blockchains.BTC, false);
1921

2022
let first = true;
2123
keypair.blockchains.map(blockchain => {
22-
const accounts = scatter.keychain.accounts.filter(x => x.keypairUnique === keypair.unique() && x.blockchain() === blockchain);
24+
const accounts = scatter.keychain.accounts.filter(x => x.keypairUnique === keypair.unique() && x.networkUnique.split(':')[0] === blockchain);
2325
if(accounts.length){
2426
const clone = keypair.clone();
2527
if(!first) {
@@ -55,5 +57,5 @@ export const m11_0_0 = async scatter => {
5557

5658
scatter.settings.explorers[Blockchains.BTC] = Explorer.fromRaw(PluginRepository.plugin(Blockchains.BTC).defaultExplorer());
5759

58-
return true;
59-
};
60+
return true;
61+
};

src/migrations/12.0.0.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import {blockchainName, Blockchains, BlockchainsArray} from "@walletpack/core/models/Blockchains";
2+
3+
export const m12_0_0 = async scatter => {
4+
5+
if(scatter.hasOwnProperty('recurring')) delete scatter.recurring;
6+
7+
return true;
8+
};

src/migrations/version.js

+1
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,4 @@ export * from './10.0.0';
44
export * from './10.1.0';
55
export * from './10.2.0';
66
export * from './11.0.0';
7+
export * from './12.0.0';

src/services/utility/SingletonService.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ export default class SingletonService {
2424
PluginRepository.plugin(Blockchains.TRX).init();
2525

2626
try {
27-
store.dispatch(UIActions.SET_TESTING_MODE, await window.wallet.storage.getGeneralSetting('testingMode').catch(() => false));
28-
} catch(e){}
27+
store.dispatch(UIActions.SET_TESTING_MODE, await window.wallet.storage.getGeneralSetting('testingMode'));
28+
} catch(e){
29+
console.error('e', e);
30+
}
2931

3032
store.dispatch(Actions.LOAD_HISTORY);
3133
store.dispatch(UIActions.SET_TOKEN_METAS, await GET('tokenmeta'));

src/store/actions.js

+3-2
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export const actions = {
5858
if (!scatter) return null;
5959

6060
scatter = Scatter.fromJson(scatter);
61+
commit(Actions.SET_SCATTER, scatter);
6162

6263
if(!isPopOut && !migrationChecked){
6364
migrationChecked = true;
@@ -72,11 +73,11 @@ export const actions = {
7273
) scatter.keychain.removeAccount(account);
7374
});
7475

75-
7676
scatter.meta.regenerateVersion();
77+
commit(Actions.SET_SCATTER, scatter);
7778
}
7879

79-
return commit(Actions.SET_SCATTER, scatter);
80+
return true;
8081
},
8182

8283
[UIActions.CREATE_SCATTER]:({state, commit, dispatch}, password) => {

src/util/WalletHelpers.js

+2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ export default class WalletHelpers {
3232
}
3333
popup.data.props.appData = AppsService.getAppData(popup.data.props.payload.origin);
3434

35+
popup.dimensions = popup.dimensions();
36+
3537
return await WindowService.openPopOut(popup);
3638
}
3739

src/views/Account.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
const plugin = PluginRepository.plugin(this.account.blockchain());
122122
const hasActions = plugin.hasAccountActions();
123123
if(!hasActions) return null;
124-
return plugin.accountActions(this.account);
124+
return plugin.accountActions(this.account).filter(x => x.type !== 'proxy_vote');
125125
},
126126
},
127127
mounted(){

0 commit comments

Comments
 (0)