Skip to content

Commit 52db0f0

Browse files
authored
Merge pull request #421 from Adamant-im/dev
v3.0.0
2 parents 85997fc + 3a13db2 commit 52db0f0

30 files changed

+693
-102
lines changed

.travis.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
language: node_js
22
node_js:
3-
- 10
3+
- 14
44
os:
55
- linux
66
cache:
77
directories:
88
- node_modules
99
install:
10-
- yarn install
10+
- yarn install --ignore-engines
1111
before_deploy:
1212
- source ./deploy.sh
1313
deploy:
1414
provider: surge
1515
project: ./dist/
16-
domain: $SUBDOMAIN-adamant-im.surge.sh
16+
domain: $SUBDOMAIN-adamant-pwa.surge.sh
1717
skip_cleanup: true
1818
on:
1919
all_branches: true

package.json

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "adamant-im",
3-
"version": "2.15.0",
3+
"version": "3.0.0",
44
"author": "ADAMANT Foundation <[email protected]>",
55
"license": "GPLv3",
66
"description": "Decentralized Messenger",
@@ -20,30 +20,30 @@
2020
"dependencies": {
2121
"@liskhq/lisk-cryptography": "3.2.0",
2222
"@liskhq/lisk-transactions": "5.2.0",
23-
"@mdi/font": "^6.3.95",
23+
"@mdi/font": "^6.5.95",
2424
"@stablelib/utf8": "^1.0.1",
2525
"@zxing/library": "0.18.6",
2626
"abi-decoder": "^2.4.0",
27-
"axios": "^0.23.0",
27+
"axios": "^0.24.0",
2828
"b64-to-blob": "^1.2.19",
2929
"bignumber.js": "^9.0.1",
3030
"bip39": "^3.0.4",
3131
"bitcoinjs-lib": "^5.2.0",
3232
"bytebuffer": "^5.0.1",
3333
"coininfo": "^5.1.0",
34-
"core-js": "^3.18.3",
34+
"core-js": "^3.19.1",
3535
"dayjs": "^1.10.7",
3636
"deepmerge": "^4.2.2",
3737
"detect-browser": "^5.2.1",
3838
"dompurify": "^2.3.3",
3939
"ed2curve": "^0.3.0",
4040
"file-saver": "^2.0.5",
4141
"hdkey": "^2.0.1",
42-
"idb": "^6.1.5",
42+
"idb": "^7.0.0",
4343
"js-base64": "^3.7.2",
4444
"js-md5": "^0.7.3",
4545
"lodash": "^4.17.21",
46-
"marked": "^3.0.7",
46+
"marked": "^4.0.4",
4747
"notifyjs": "^3.0.0",
4848
"pbkdf2": "^3.1.2",
4949
"promise-queue": "^2.2.5",
@@ -57,47 +57,47 @@
5757
"throttle-promise": "^1.0.4",
5858
"visibilityjs": "^2.0.2",
5959
"vue": "^2.6.14",
60-
"vue-i18n": "^8.26.5",
61-
"vue-router": "^3.5.2",
60+
"vue-i18n": "^8.26.7",
61+
"vue-router": "^3.5.3",
6262
"vue-scrollto": "^2.20.0",
6363
"vuetify": "^1.5.24",
6464
"vuex": "^3.6.2",
6565
"vuex-persist": "^3.1.3",
66-
"web3-eth": "^1.6.0",
67-
"web3-utils": "^1.6.0"
66+
"web3-eth": "^1.6.1",
67+
"web3-utils": "^1.6.1"
6868
},
6969
"devDependencies": {
70-
"@babel/core": "7.15.8",
71-
"@babel/eslint-parser": "^7.15.8",
70+
"@babel/core": "7.16.0",
71+
"@babel/eslint-parser": "^7.16.3",
7272
"@intlify/vue-i18n-loader": "^1.1.0",
73-
"@vue/babel-preset-app": "^4.5.14",
74-
"@vue/cli-plugin-babel": "^4.5.14",
75-
"@vue/cli-plugin-e2e-cypress": "^4.5.14",
76-
"@vue/cli-plugin-eslint": "^4.5.14",
77-
"@vue/cli-plugin-pwa": "^4.5.14",
78-
"@vue/cli-plugin-unit-jest": "^4.5.14",
79-
"@vue/cli-service": "^4.5.14",
73+
"@vue/babel-preset-app": "^4.5.15",
74+
"@vue/cli-plugin-babel": "^4.5.15",
75+
"@vue/cli-plugin-e2e-cypress": "^4.5.15",
76+
"@vue/cli-plugin-eslint": "^4.5.15",
77+
"@vue/cli-plugin-pwa": "^4.5.15",
78+
"@vue/cli-plugin-unit-jest": "^4.5.15",
79+
"@vue/cli-service": "^4.5.15",
8080
"@vue/eslint-config-standard": "^6.1.0",
81-
"@vue/test-utils": "^1.2.2",
81+
"@vue/test-utils": "^1.3.0",
8282
"babel-core": "7.0.0-bridge.0",
8383
"babel-jest": "^27.3.1",
8484
"babel-plugin-rewire": "^1.2.0",
8585
"cross-env": "^7.0.3",
8686
"electron": "^3.0.0",
8787
"eslint": "^7.31.0",
8888
"eslint-config-standard": "^16.0.3",
89-
"eslint-plugin-import": "^2.25.2",
89+
"eslint-plugin-import": "^2.25.3",
9090
"eslint-plugin-node": "^11.1.0",
9191
"eslint-plugin-promise": "^5.1.1",
9292
"eslint-plugin-vue": "^7.20.0",
9393
"lorem-ipsum": "^2.0.4",
94-
"sinon": "^11.1.2",
94+
"sinon": "^12.0.1",
9595
"stylus": "^0.55.0",
9696
"stylus-loader": "^3.0.2",
9797
"uuid": "^8.3.2",
9898
"vue-cli-plugin-electron-builder": "^2.1.1",
9999
"vue-cli-plugin-i18n": "^2.3.1",
100-
"vue-cli-plugin-vuetify": "^2.4.3",
100+
"vue-cli-plugin-vuetify": "^2.4.4",
101101
"vue-cli-plugin-webpack-bundle-analyzer": "^4.0.0",
102102
"vue-jest": "^3.0.7",
103103
"vue-template-compiler": "^2.6.14",

src/assets/stylus/themes/adamant/_typography.styl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@
4242
.a-text-active
4343
a-text-active()
4444

45+
.a-text-attention
46+
a-text-attention()
47+
4548
.theme--light
4649
.a-text-regular,
4750
.a-text-regular-bold,
@@ -62,6 +65,12 @@
6265
.a-divider
6366
border-color: $adm-colors.secondary
6467

68+
.a-text-attention
69+
background-color: $adm-colors.danger
70+
6571
.theme--dark
6672
.a-text-regular
6773
color: $shades.white
74+
75+
.a-text-attention
76+
background-color: $adm-colors.danger

src/components/BuyTokensDialog.vue

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,19 +105,13 @@ export default {
105105
link: websiteUriToOnion(this.adamantAddress
106106
? `${this.$t('home.buy_tokens_btn_link')}?wallet=${this.adamantAddress}`
107107
: `${this.$t('home.buy_tokens_btn_link')}`)
108-
},
109-
{
110-
icon: 'RES',
111-
title: 'Resfinex',
112-
link: 'https://trade.resfinex.com?ref=7ccb34d867&pair=ADM_USDT'
113108
}
114109
]
115110
}
116111
},
117112
methods: {
118113
openLink (link) {
119114
if (link.startsWith('U')) {
120-
console.log('routing to ', link)
121115
this.$router.push({
122116
name: 'Chat',
123117
params: { partnerId: link }

src/components/Chat/Chat.vue

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ export default {
209209
data: () => ({
210210
chatFormLabel: '',
211211
loading: false,
212+
noMoreMessages: false,
212213
isScrolledToBottom: true,
213214
visibilityId: null,
214215
showFreeTokensDialog: false
@@ -240,6 +241,15 @@ export default {
240241
sendMessageOnEnter () {
241242
return this.$store.state.options.sendMessageOnEnter
242243
},
244+
isFulfilled () {
245+
return this.$store.state.chat.isFulfilled
246+
},
247+
lastMessage () {
248+
return this.$store.getters['chat/lastMessage'](this.partnerId)
249+
},
250+
chatPage () {
251+
return this.$store.getters['chat/chatPage'](this.partnerId)
252+
},
243253
scrollPosition () {
244254
return this.$store.getters['chat/scrollPosition'](this.partnerId)
245255
},
@@ -263,6 +273,10 @@ export default {
263273
264274
if (!Visibility.hidden()) this.markAsRead()
265275
})
276+
},
277+
// watch `isFulfilled` when opening chat directly from address bar
278+
isFulfilled (value) {
279+
if (value && (!this.chatPage || this.chatPage <= 0)) this.fetchChatMessages()
266280
}
267281
},
268282
created () {
@@ -273,6 +287,8 @@ export default {
273287
Visibility.unbind(this.visibilityId)
274288
},
275289
mounted () {
290+
if (this.isFulfilled && this.chatPage <= 0) this.fetchChatMessages()
291+
276292
this.scrollBehavior()
277293
this.$nextTick(() => {
278294
this.isScrolledToBottom = this.$refs.chat.isScrolledToBottom()
@@ -317,7 +333,7 @@ export default {
317333
this.$store.commit('chat/markAsRead', this.partnerId)
318334
},
319335
onScrollTop () {
320-
//
336+
this.fetchChatMessages()
321337
},
322338
onScrollBottom () {
323339
this.markAsRead()
@@ -370,6 +386,21 @@ export default {
370386
371387
return sanitizeHTML(transaction.message)
372388
},
389+
fetchChatMessages () {
390+
if (this.noMoreMessages) return
391+
if (this.loading) return
392+
393+
this.loading = true
394+
395+
return this.$store.dispatch('chat/getChatRoomMessages', { contactId: this.partnerId })
396+
.catch(() => {
397+
this.noMoreMessages = true
398+
})
399+
.finally(() => {
400+
this.loading = false
401+
this.$refs.chat.maintainScrollPosition()
402+
})
403+
},
373404
scrollBehavior () {
374405
this.$nextTick(() => {
375406
if (this.numOfNewMessages > 0) {

src/components/Chat/ChatAvatar.vue

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,13 @@ export default {
9797
.then(key => {
9898
identicon.avatar(el, key, this.canvasSize)
9999
100+
return el.toDataURL()
101+
})
102+
.catch(() => {
103+
// use `userId` to generate identicon if the user
104+
// does not have a public key yet
105+
identicon.avatar(el, this.userId, this.canvasSize)
106+
100107
return el.toDataURL()
101108
})
102109
} else {

src/components/ChatPreview.vue

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
<template>
22
<v-list-tile
3+
v-if="isLoadingSeparator"
4+
>
5+
<v-list-tile-content
6+
style="align-items: center"
7+
>
8+
<v-icon
9+
ref="loadingDots"
10+
:class="{ kmove: isLoadingSeparatorActive }"
11+
>
12+
mdi-dots-horizontal
13+
</v-icon>
14+
</v-list-tile-content>
15+
</v-list-tile>
16+
<v-list-tile
17+
v-else
318
:class="className"
419
@click="$emit('click')"
520
>
@@ -129,6 +144,14 @@ export default {
129144
isAdamantChat: {
130145
type: Boolean,
131146
default: false
147+
},
148+
isLoadingSeparator: {
149+
type: Boolean,
150+
default: false
151+
},
152+
isLoadingSeparatorActive: {
153+
type: Boolean,
154+
default: false
132155
}
133156
},
134157
data: () => ({
@@ -212,6 +235,19 @@ export default {
212235
@import '../assets/stylus/settings/_colors.styl'
213236
@import '../assets/stylus/themes/adamant/_mixins.styl'
214237
238+
@keyframes movement {
239+
from { left: -50px }
240+
to { left: 50px }
241+
}
242+
243+
.kmove {
244+
position: relative;
245+
animation-name: movement;
246+
animation-duration: 0.5s;
247+
animation-iteration-count: infinite;
248+
animation-direction: alternate;
249+
}
250+
215251
/**
216252
* 1. Message/Transaction content.
217253
*/

src/components/SendFundsForm.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -630,7 +630,7 @@ export default {
630630
})
631631
.catch(error => {
632632
const formattedError = formatSendTxError(error)
633-
console.log('Error while sending transaction', formattedError)
633+
console.warn('Error while sending transaction', formattedError)
634634
let message = formattedError.errorMessage
635635
if (/dust/i.test(message) || get(error, 'response.data.error.code') === -26) {
636636
message = this.$t('transfer.error_dust_amount')

0 commit comments

Comments
 (0)