Skip to content

Commit

Permalink
fix empty pane id
Browse files Browse the repository at this point in the history
  • Loading branch information
Tucsky committed Jul 11, 2021
1 parent 28c6a86 commit f45657f
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .env.github
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ NODE_ENV=production
API_URL=https://api.aggr.trade/historical/{from}/{to}/{timeframe}/{markets}
PROXY_URL=https://cors.aggr.trade/
PUBLIC_PATH=/aggr/
API_SUPPORTED_PAIRS=BITFINEX:BTCUSD,BINANCE:btcusdt,OKEX:BTC-USDT,KRAKEN:XBT/USD,COINBASE:BTC-USD,POLONIEX:USDT_BTC,HUOBI:btcusdt,BITSTAMP:btcusd,BITMEX:XBTUSD,BITFINEX:BTCF0:USTF0,OKEX:BTC-USD-SWAP,OKEX:BTC-USDT-SWAP,BINANCE_FUTURES:btcusdt,BINANCE_FUTURES:btcusd_perp,HUOBI:BTC-USD,KRAKEN:PI_XBTUSD,DERIBIT:BTC-PERPETUAL,FTX:BTC-PERP,BYBIT:BTCUSD,BYBIT:BTCUSDT,FTX:BTC/USDT,FTX:BTC/USD,BINANCE_FUTURES:ethusdt,BINANCE_FUTURES:ethusd_perp,BITFINEX:ETHUSD,BITMEX:ETHUSD,BITSTAMP:ethusd,BYBIT:ETHUSD,BYBIT:ETHUSDT,COINBASE:ETH-USD,DERIBIT:ETH-PERPETUAL,FTX:ETH-PERP,FTX:ETH/USD,FTX:ETH/USDT,HUOBI:ethusdt,HUOBI:ETH-USD,KRAKEN:ETH/USD,KRAKEN:PI_ETHUSD,OKEX:ETH-USDT,OKEX:ETH-USDT-SWAP,OKEX:ETH-USD-SWAP,BITFINEX:DOGE:USD,COINBASE:DOGE-USD,COINBASE:DOGE-USDT,FTX:DOGE/USD,FTX:DOGE/USDT,HUOBI:DOGE-USD,OKEX:DOGE-USDT,OKEX:DOGE-USDT-SWAP,OKEX:DOGE-USD-SWAP,BINANCE:dogeusdt,BITMEX:DOGEUSDT,BINANCE_FUTURES:dogeusdt,BINANCE_FUTURES:dogeusd_perp,HUOBI:dogeusdt,BINANCE:linkusdt,BINANCE_FUTURES:linkusdt,BINANCE_FUTURES:linkusd_perp,BITFINEX:LINK:USD,BITMEX:LINKUSDT,BITSTAMP:linkusd,COINBASE:LINK-USD,FTX:LINK/USD,FTX:LINK/USDT,HUOBI:linkusdt,HUOBI:LINK-USD,KRAKEN:LINK/USD,KRAKEN:LINK/USDT,OKEX:LINK-USDT,HITBTC:LINKUSD,OKEX:LINK-USD-SWAP,OKEX:LINK-USDT-SWAP,BITFINEX:LINK:UST,BITFINEX:LINKF0:USTF0,BYBIT:LINKUSDT
API_SUPPORTED_PAIRS=BITFINEX:BTCUSD,BINANCE:btcusdt,OKEX:BTC-USDT,KRAKEN:XBT/USD,COINBASE:BTC-USD,POLONIEX:USDT_BTC,HUOBI:btcusdt,BITSTAMP:btcusd,BITMEX:XBTUSD,BITFINEX:BTCF0:USTF0,OKEX:BTC-USD-SWAP,OKEX:BTC-USDT-SWAP,BINANCE_FUTURES:btcusdt,BINANCE_FUTURES:btcusd_perp,HUOBI:BTC-USD,KRAKEN:PI_XBTUSD,DERIBIT:BTC-PERPETUAL,FTX:BTC-PERP,BYBIT:BTCUSD,BYBIT:BTCUSDT,FTX:BTC/USDT,FTX:BTC/USD,BINANCE_FUTURES:ethusdt,BINANCE_FUTURES:ethusd_perp,BITFINEX:ETHUSD,BITMEX:ETHUSD,BITSTAMP:ethusd,BYBIT:ETHUSD,BYBIT:ETHUSDT,COINBASE:ETH-USD,DERIBIT:ETH-PERPETUAL,FTX:ETH-PERP,FTX:ETH/USD,FTX:ETH/USDT,HUOBI:ethusdt,HUOBI:ETH-USD,KRAKEN:ETH/USD,KRAKEN:PI_ETHUSD,OKEX:ETH-USDT,OKEX:ETH-USDT-SWAP,OKEX:ETH-USD-SWAP,BITFINEX:DOGE:USD,COINBASE:DOGE-USD,COINBASE:DOGE-USDT,FTX:DOGE/USD,FTX:DOGE/USDT,HUOBI:DOGE-USD,OKEX:DOGE-USDT,OKEX:DOGE-USDT-SWAP,OKEX:DOGE-USD-SWAP,BINANCE:dogeusdt,BITMEX:DOGEUSDT,BINANCE_FUTURES:dogeusdt,BINANCE_FUTURES:dogeusd_perp,HUOBI:dogeusdt,BINANCE:linkusdt,BINANCE_FUTURES:linkusdt,BINANCE_FUTURES:linkusd_perp,BITFINEX:LINK:USD,BITMEX:LINKUSDT,BITSTAMP:linkusd,COINBASE:LINK-USD,FTX:LINK/USD,FTX:LINK/USDT,HUOBI:linkusdt,HUOBI:LINK-USD,KRAKEN:LINK/USD,KRAKEN:LINK/USDT,OKEX:LINK-USDT,OKEX:LINK-USD-SWAP,OKEX:LINK-USDT-SWAP,BITFINEX:LINKF0:USTF0,BYBIT:LINKUSDT
11 changes: 8 additions & 3 deletions src/components/panes/PaneHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -133,11 +133,16 @@ export default class extends Vue {
]
get name() {
const name = this.$store.state.panes.panes[this.paneId].name
let name = this.$store.state.panes.panes[this.paneId].name
const markets = this.$store.state.panes.panes[this.paneId].markets
if (!name) {
const [, pair] = parseMarket(this.$store.state.panes.panes[this.paneId].markets[0])
return pair
if (markets.length) {
const [, pair] = parseMarket(markets[0])
return pair
} else {
name = this.paneId
}
}
return name
Expand Down
4 changes: 3 additions & 1 deletion src/components/trades/Trades.vue
Original file line number Diff line number Diff line change
Expand Up @@ -695,11 +695,13 @@ export default class extends Mixins(PaneMixin) {
continue
}
const pairElement = element.querySelector('.trade__pair') as HTMLElement
const timestamp = element.querySelector('.trade__time').getAttribute('timestamp')
const price = parseFloat((element.querySelector('.trade__price') as HTMLElement).innerText) || 0
const size = parseFloat((element.querySelector('.trade__amount__base') as HTMLElement).innerText) || 0
const side: 'buy' | 'sell' = element.classList.contains('-buy') ? 'buy' : 'sell'
const symbol = (element.querySelector('.trade__pair') as HTMLElement).innerText
const symbol = pairElement ? pairElement.innerText : null
const trade: Trade = {
timestamp: (timestamp as unknown) as number,
Expand Down
2 changes: 1 addition & 1 deletion src/store/panes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ const actions = {
}

const name = options.name || ''
const id = uniqueName(slugify(name), Object.keys(state.panes))
const id = uniqueName(slugify(name || options.type), Object.keys(state.panes))

const pane: Pane = {
id,
Expand Down

0 comments on commit f45657f

Please sign in to comment.