fix: review

This commit is contained in:
Richard Ramos 2021-11-15 11:06:25 -04:00
parent 1989ad7971
commit f9b08abd72
4 changed files with 8 additions and 3 deletions

View File

@ -35,9 +35,9 @@ method delete*(self: Module) =
method load*(self: Module) =
singletonInstance.engine.setRootContextProperty("providerModule", self.viewVariant)
self.view.load()
self.view.dappsAddress = self.controller.getDappsAddress()
self.view.networkId = self.controller.getCurrentNetworkDetails().config.networkId
self.view.load()
method isLoaded*(self: Module): bool =
return self.moduleLoaded

View File

@ -46,7 +46,7 @@ QtObject:
proc networkId*(self: View): int {.slot.} =
result = self.networkId
QtProperty[string] networkId:
QtProperty[int] networkId:
read = networkId
notify = networkIdChanged

View File

@ -55,6 +55,7 @@ method clearPermissions*(self: Service, dapp: string): bool =
method revoke*(self: Service, permission: Permission): bool =
try:
var dappsToDelete: seq[string] = @[]
for dapp in self.dapps.mvalues:
if dapp.permissions.contains(permission):
dapp.permissions.excl(permission)
@ -62,7 +63,9 @@ method revoke*(self: Service, permission: Permission): bool =
discard status_go.addDappPermissions(dapp.name, dapp.permissions.toSeq().mapIt($it))
else:
discard status_go.deleteDappPermissions(dapp.name)
self.dapps.del(dapp.name)
dappsToDelete.add(dapp.name)
for dappName in dappsToDelete:
self.dapps.del(dappName)
return true
except Exception as e:
let errDescription = e.msg

View File

@ -8,6 +8,8 @@ QtObject {
property var web3ProviderInst: providerModule
property var urlENSDictionary: ({})
property int networkId: providerModule.networkId
function determineRealURL(text){
var url = RootStore.getUrlFromUserInput(text);
var host = providerModule.getHost(url);