Skip to content

Commit 43c6125

Browse files
authored
Merge pull request #869 from aeternity/release/0.3.0
Release 0.3.0
2 parents b9a82bc + 70d830d commit 43c6125

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+2857
-1668
lines changed

.env

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
VUE_APP_WALLET_URL=https://wallet.superhero.com
2-
VUE_APP_JITSI_URL=meet.aepps.com
2+
VUE_APP_JITSI_HOST=meet.aepps.com
33
VUE_APP_BACKEND_URL=https://raendom-backend.z52da5wt.xyz
4+
VUE_APP_NODE_URL=https://mainnet.aeternity.io
5+
VUE_APP_EXPLORER_URL=https://mainnet.aeternal.io
6+
VUE_APP_COMPILER_URL=https://latest.compiler.aepps.com
47
VUE_APP_CONTRACT_V1_ADDRESS=ct_2AfnEfCSZCTEkxL5Yoi4Yfq6fF7YapHRaFKDJK3THMXMBspp5z
58
VUE_APP_CONTRACT_V2_ADDRESS=

.env.e2e

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
VUE_APP_BACKEND_URL=https://testnet.superhero.aeternity.art
1+
VUE_APP_BACKEND_URL=https://test-tipping.aeternity.art
2+
VUE_APP_NODE_URL=https://testnet.aeternity.io
3+
VUE_APP_EXPLORER_URL=https://testnet.aeternal.io
24
VUE_APP_CONTRACT_V1_ADDRESS=ct_2GRP3xp7KWrKtZSnYfdcLnreRWrntWf5aTsxtLqpBHp71EFc3i
35
VUE_APP_CONTRACT_V2_ADDRESS=

package-lock.json

Lines changed: 34 additions & 30 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "superhero-ui",
3-
"version": "0.2.1",
3+
"version": "0.3.0",
44
"scripts": {
55
"serve": "vue-cli-service serve",
66
"build": "vue-cli-service build",
@@ -16,22 +16,21 @@
1616
},
1717
"license": "ISC",
1818
"dependencies": {
19-
"tipping-contract": "github:aeternity/tipping-contract#develop",
20-
"aeternity-fungible-token": "github:mradkov/aeternity-fungible-token",
2119
"@aeternity/aepp-sdk": "^7.7.0",
22-
"@aeternity/superhero-button": "^0.1.3",
2320
"@dicebear/avatars": "^4.2.5",
2421
"@dicebear/avatars-avataaars-sprites": "^4.2.5",
22+
"aeternity-fungible-token": "github:mradkov/aeternity-fungible-token",
2523
"autosize": "^4.0.2",
2624
"axios": "^0.19.0",
2725
"bignumber.js": "^9.0.0",
2826
"bootstrap": "^4.5.2",
2927
"core-js": "^3.6.5",
30-
"detect-browser": "^4.8.0",
3128
"i18n": "^0.8.6",
3229
"jdenticon": "^2.2.0",
3330
"jitsi-iframe-api": "^1.0.0",
3431
"lodash-es": "^4.17.15",
32+
"soundcloud-widget": "^0.2.1",
33+
"tipping-contract": "github:aeternity/tipping-contract#develop",
3534
"vue": "^2.6.12",
3635
"vue-i18n": "^8.21.1",
3736
"vue-router": "^3.4.5",

src/App.vue

Lines changed: 28 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,5 @@
11
<template>
22
<div id="app">
3-
<div
4-
v-if="isSupportedBrowser"
5-
class="supportedbrowser--alert"
6-
>
7-
{{ $t('noExtensionSupport') }}
8-
</div>
93
<MobileNavigation v-if="!$route.meta.fullScreen" />
104
<div class="not-bootstrap-row">
115
<div
@@ -33,13 +27,10 @@
3327

3428
<script>
3529
import { mapMutations, mapState, mapGetters } from 'vuex';
36-
import { detect } from 'detect-browser';
37-
import {
38-
client, initClient, scanForWallets, tokenBalance,
39-
} from './utils/aeternity';
30+
import { initSdk, scanForWallets, tokenBalance } from './utils/aeternity';
4031
import Backend from './utils/backend';
4132
import { EventBus } from './utils/eventBus';
42-
import { IS_MOBILE_DEVICE, supportedBrowsers, atomsToAe } from './utils';
33+
import { atomsToAe } from './utils';
4334
import MobileNavigation from './components/layout/MobileNavigation.vue';
4435
import LeftSection from './components/layout/LeftSection.vue';
4536
import RightSection from './components/layout/RightSection.vue';
@@ -48,31 +39,28 @@ export default {
4839
components: { MobileNavigation, LeftSection, RightSection },
4940
computed: {
5041
...mapGetters('modals', ['opened']),
51-
...mapState(['address']),
52-
isSupportedBrowser() {
53-
const browser = detect();
54-
return !IS_MOBILE_DEVICE && (browser && !supportedBrowsers.includes(browser.name));
55-
},
42+
...mapState(['address', 'sdk']),
5643
},
5744
async created() {
5845
EventBus.$on('reloadData', () => {
5946
this.reloadData();
6047
});
6148
setInterval(() => this.reloadData(), 120 * 1000);
62-
EventBus.$on('backendError', () => this.$route.name !== 'maintenance' && this.$router.push({
63-
name: 'maintenance',
64-
}).catch((err) => { console.error(err); }));
65-
await this.initialLoad();
49+
50+
await initSdk();
51+
await Promise.all([
52+
this.initWallet(),
53+
this.reloadData(),
54+
]);
6655
},
6756
methods: {
6857
...mapMutations([
69-
'setLoggedInAccount', 'updateTopics', 'updateCurrencyRates',
70-
'setOracleState', 'addLoading', 'removeLoading', 'setChainNames', 'updateBalance',
58+
'setAddress', 'updateTopics', 'updateCurrencyRates',
59+
'setOracleState', 'setChainNames', 'updateBalance',
7160
'setGraylistedUrls', 'setTokenInfo', 'setVerifiedUrls', 'useSdkWallet', 'addTokenBalance',
7261
'setPinnedItems',
7362
]),
7463
async reloadData() {
75-
// await fetch
7664
const [
7765
chainNames, oracleState, topics, verifiedUrls, graylistedUrls, tokenInfo,
7866
] = await Promise.all([
@@ -84,62 +72,42 @@ export default {
8472
Backend.getTokenInfo(),
8573
this.$store.dispatch('backend/reloadStats'),
8674
this.$store.dispatch('backend/reloadPrices'),
75+
this.reloadUserData(),
8776
]);
8877
89-
if (this.address) {
90-
const balance = await client.balance(this.address).catch(() => 0);
91-
this.updateBalance(atomsToAe(balance).toFixed(2));
92-
}
93-
94-
// async fetch
9578
this.updateTopics(topics);
9679
this.setChainNames(chainNames);
9780
this.setOracleState(oracleState);
9881
this.setGraylistedUrls(graylistedUrls);
9982
this.setVerifiedUrls(verifiedUrls);
10083
this.setTokenInfo(tokenInfo);
101-
if (this.address) this.loadTokenBalances(this.address);
10284
},
103-
async fetchUserData() {
85+
async reloadUserData() {
86+
if (!this.address) return;
10487
await Promise.all([
10588
this.$store.dispatch('updatePinnedItems'),
10689
this.$store.dispatch('updateUserProfile'),
90+
(async () => {
91+
const balance = await this.sdk.balance(this.address).catch(() => 0);
92+
this.updateBalance(atomsToAe(balance).toFixed(2));
93+
})(),
94+
(async () => {
95+
const tokens = await Backend.getTokenBalances(this.address);
96+
await Promise.all(Object.entries(tokens).map(async ([token]) => this
97+
.addTokenBalance({ token, balance: await tokenBalance(token, this.address) })));
98+
})(),
10799
]);
108100
},
109-
async initialLoad() {
110-
this.addLoading('initial');
111-
this.addLoading('wallet');
112-
await initClient();
113-
await this.reloadData();
114-
this.removeLoading('initial');
115-
if (this.address) {
116-
this.removeLoading('wallet');
117-
this.fetchUserData();
118-
}
119-
101+
async initWallet() {
120102
let { address } = this.$route.query;
121103
if (!address) {
122-
await scanForWallets();
123-
address = client.rpcClient.getCurrentAccount();
104+
address = await scanForWallets();
124105
console.log('found wallet');
125106
this.useSdkWallet();
107+
this.$store.dispatch('updateCookiesConsent', address);
126108
}
127-
const balance = await client.balance(address).catch(() => 0);
128-
this.setLoggedInAccount({
129-
address,
130-
balance: atomsToAe(balance).toFixed(2),
131-
});
132-
133-
// trigger run async in background
134-
this.loadTokenBalances(address);
135-
136-
this.fetchUserData();
137-
this.removeLoading('wallet');
138-
},
139-
async loadTokenBalances(address) {
140-
const tokens = await Backend.getTokenBalances(address);
141-
await Promise.all(Object.entries(tokens).map(async ([token]) => this
142-
.addTokenBalance({ token, balance: await tokenBalance(token, address) })));
109+
this.setAddress(address);
110+
await this.reloadUserData();
143111
},
144112
},
145113
};
@@ -178,11 +146,6 @@ export default {
178146
display: flex;
179147
flex-direction: column;
180148
181-
.supportedbrowser--alert {
182-
text-align: center;
183-
line-height: 3rem;
184-
}
185-
186149
.not-bootstrap-row {
187150
flex-grow: 1;
188151
display: flex;

src/assets/buttonCancel.svg

Lines changed: 0 additions & 1 deletion
This file was deleted.

src/assets/buttonPause.svg

Lines changed: 8 additions & 0 deletions
Loading

src/assets/buttonPlay.svg

Lines changed: 6 additions & 0 deletions
Loading

src/assets/cookieImg.svg

Lines changed: 45 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)