fix(@desktop/wallet): display STT token by default on test nets
This commit is contained in:
parent
b7bc528552
commit
64d2c03e40
|
@ -13,7 +13,6 @@ export service_interface
|
||||||
logScope:
|
logScope:
|
||||||
topics = "token-service"
|
topics = "token-service"
|
||||||
|
|
||||||
const DEFAULT_VISIBLE_SYMBOLS = @["SNT"]
|
|
||||||
|
|
||||||
type
|
type
|
||||||
CustomTokenAdded* = ref object of Args
|
CustomTokenAdded* = ref object of Args
|
||||||
|
@ -42,11 +41,23 @@ proc newService*(events: EventEmitter, settingService: setting_service.Service):
|
||||||
result.settingService = settingService
|
result.settingService = settingService
|
||||||
result.tokens = @[]
|
result.tokens = @[]
|
||||||
|
|
||||||
|
method getDefaultVisibleSymbols(self: Service): seq[string] =
|
||||||
|
let networkSlug = self.settingService.getSetting().currentNetwork.slug
|
||||||
|
|
||||||
|
if networkSlug == "mainnet_rpc":
|
||||||
|
return @["SNT"]
|
||||||
|
|
||||||
|
if networkSlug == "testnet_rpc" or networkSlug == "rinkeby_rpc":
|
||||||
|
return @["STT"]
|
||||||
|
|
||||||
|
return @[]
|
||||||
|
|
||||||
|
|
||||||
method init*(self: Service) =
|
method init*(self: Service) =
|
||||||
try:
|
try:
|
||||||
var activeTokenSymbols = self.settingService.getSetting().activeTokenSymbols
|
var activeTokenSymbols = self.settingService.getSetting().activeTokenSymbols
|
||||||
if activeTokenSymbols.len == 0:
|
if activeTokenSymbols.len == 0:
|
||||||
activeTokenSymbols = DEFAULT_VISIBLE_SYMBOLS
|
activeTokenSymbols = self.getDefaultVisibleSymbols()
|
||||||
|
|
||||||
let static_tokens = static_token.all().map(
|
let static_tokens = static_token.all().map(
|
||||||
proc(x: TokenDto): TokenDto =
|
proc(x: TokenDto): TokenDto =
|
||||||
|
|
Loading…
Reference in New Issue