From e6ece430f29123cc42bb81b5269ea82f90b88d00 Mon Sep 17 00:00:00 2001 From: SKANKHUNTER <31552675+MrBurrBurr@users.noreply.github.com> Date: Sat, 18 Jul 2020 22:04:56 +0200 Subject: [PATCH 1/5] Basic wallet info --- src/models/Bot.js | 19 +++++++++++++++++++ src/views/modals/Bot.vue | 7 +++++-- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/src/models/Bot.js b/src/models/Bot.js index 10de14d63..f6618e2fb 100644 --- a/src/models/Bot.js +++ b/src/models/Bot.js @@ -16,6 +16,8 @@ export class Bot { this.steamid = data.s_SteamID; this.avatarHash = data.AvatarHash || '0b46945851b3d26da93a6ddba3ac961206cc191d'; this.bgrCount = data.GamesToRedeemInBackgroundCount; + this.walletBalance = data.WalletBalance; + this.walletCurrency = data.WalletCurrency; this.active = data.KeepRunning; this.config = data.BotConfig; @@ -86,4 +88,21 @@ export class Bot { if (this.status === BotStatus.FARMING && selectedBots.includes('farming')) return true; return false; } + + get walletInfo() { + if (this.walletCurrency === 0) return; + let currency = this.walletBalance / 100; + + // Resolve ECurrencyCode + switch (this.walletCurrency) { + case 1: + countryCode = 'USD'; + break; + + default: + countryCode = 'EUR'; + } + + return currency.toLocaleString(Vue.i18n.locale, { style: 'currency', currency: countryCode }); + } } diff --git a/src/views/modals/Bot.vue b/src/views/modals/Bot.vue index cc0401900..6d478cd6e 100644 --- a/src/views/modals/Bot.vue +++ b/src/views/modals/Bot.vue @@ -15,6 +15,9 @@
{{ bot.statusText }}
@@ -132,9 +135,9 @@ .bot-profile__avatar-wrapper { background: var(--color-status); grid-area: avatar; - height: 75px; + height: 80px; padding: 2px; - width: 75px; + width: 80px; } .bot-profile__avatar { From 9434bb922cb9b01aef93a1062cb7d6d3f3b03ad9 Mon Sep 17 00:00:00 2001 From: SKANKHUNTER <31552675+MrBurrBurr@users.noreply.github.com> Date: Sun, 19 Jul 2020 00:24:56 +0200 Subject: [PATCH 2/5] Misc --- src/models/Bot.js | 9 ++++----- src/views/modals/Bot.vue | 29 +++++++++++++++++++---------- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/src/models/Bot.js b/src/models/Bot.js index f6618e2fb..abf1d9264 100644 --- a/src/models/Bot.js +++ b/src/models/Bot.js @@ -90,17 +90,16 @@ export class Bot { } get walletInfo() { - if (this.walletCurrency === 0) return; - let currency = this.walletBalance / 100; + if (this.walletCurrency === 0) return null; + const currency = this.walletBalance / 100; + let countryCode = 'EUR'; // Resolve ECurrencyCode switch (this.walletCurrency) { case 1: countryCode = 'USD'; break; - - default: - countryCode = 'EUR'; + //... } return currency.toLocaleString(Vue.i18n.locale, { style: 'currency', currency: countryCode }); diff --git a/src/views/modals/Bot.vue b/src/views/modals/Bot.vue index 6d478cd6e..8c08cf0d3 100644 --- a/src/views/modals/Bot.vue +++ b/src/views/modals/Bot.vue @@ -9,14 +9,18 @@