Only load in new transactions on page 1

Co-authored-by: Stamates <stamates@hotmail.com>
pull/333/head
jimmay5469 7 years ago
parent 62dc04a75b
commit a15f357998
  1. 26
      apps/explorer_web/assets/js/pages/address.js
  2. 5
      apps/explorer_web/assets/package-lock.json
  3. 3
      apps/explorer_web/assets/package.json

@ -1,4 +1,5 @@
import $ from 'jquery'
import URI from 'urijs'
import socket from '../socket'
if (window.page === 'address') {
@ -7,17 +8,20 @@ if (window.page === 'address') {
.receive('ok', resp => { console.log('Joined successfully', `addresses:${window.addressHash}`, resp) })
.receive('error', resp => { console.log('Unable to join', `addresses:${window.addressHash}`, resp) })
const $emptyTransactionsList = $('[data-selector="empty-transactions-list"]')
if ($emptyTransactionsList) {
channel.on('transaction', () => {
window.location.reload()
})
}
const currentLocation = URI(window.location)
if(!currentLocation.hasQuery('block_number')) {
const $emptyTransactionsList = $('[data-selector="empty-transactions-list"]')
if ($emptyTransactionsList) {
channel.on('transaction', () => {
window.location.reload()
})
}
const $transactionsList = $('[data-selector="transactions-list"]')
if ($transactionsList) {
channel.on('transaction', (msg) => {
$transactionsList.prepend(msg.transaction)
})
const $transactionsList = $('[data-selector="transactions-list"]')
if ($transactionsList) {
channel.on('transaction', (msg) => {
$transactionsList.prepend(msg.transaction)
})
}
}
}

@ -8164,6 +8164,11 @@
"punycode": "^2.1.0"
}
},
"urijs": {
"version": "1.19.1",
"resolved": "https://registry.npmjs.org/urijs/-/urijs-1.19.1.tgz",
"integrity": "sha512-xVrGVi94ueCJNrBSTjWqjvtgvl3cyOTThp2zaMaFNGp3F542TR6sM3f2o8RqZl+AwteClSVmoCyt0ka4RjQOQg=="
},
"urix": {
"version": "0.1.0",
"resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz",

@ -28,7 +28,8 @@
"numeral": "^2.0.6",
"phoenix": "file:../../../deps/phoenix",
"phoenix_html": "file:../../../deps/phoenix_html",
"popper.js": "^1.14.3"
"popper.js": "^1.14.3",
"urijs": "^1.19.1"
},
"devDependencies": {
"@babel/polyfill": "^7.0.0-beta.46",

Loading…
Cancel
Save