feat(shared_addresses): get old shared addresses for the edit popup
Fixes #11973
This commit is contained in:
parent
7ae28ec386
commit
bc4a150afa
|
@ -34,6 +34,7 @@ type
|
||||||
chatService: chat_service.Service
|
chatService: chat_service.Service
|
||||||
tmpCommunityId: string
|
tmpCommunityId: string
|
||||||
tmpCommunityIdForChannelsPermisisons: string
|
tmpCommunityIdForChannelsPermisisons: string
|
||||||
|
tmpCommunityIdForRevealedAccounts: string
|
||||||
tmpAuthenticationAction: AuthenticationAction
|
tmpAuthenticationAction: AuthenticationAction
|
||||||
tmpRequestToJoinEnsName: string
|
tmpRequestToJoinEnsName: string
|
||||||
tmpAddressesToShare: seq[string]
|
tmpAddressesToShare: seq[string]
|
||||||
|
@ -61,6 +62,7 @@ proc newController*(
|
||||||
result.chatService = chatService
|
result.chatService = chatService
|
||||||
result.tmpCommunityId = ""
|
result.tmpCommunityId = ""
|
||||||
result.tmpCommunityIdForChannelsPermisisons = ""
|
result.tmpCommunityIdForChannelsPermisisons = ""
|
||||||
|
result.tmpCommunityIdForRevealedAccounts = ""
|
||||||
result.tmpRequestToJoinEnsName = ""
|
result.tmpRequestToJoinEnsName = ""
|
||||||
result.tmpAirdropAddress = ""
|
result.tmpAirdropAddress = ""
|
||||||
result.tmpAddressesToShare = @[]
|
result.tmpAddressesToShare = @[]
|
||||||
|
@ -179,6 +181,16 @@ proc init*(self: Controller) =
|
||||||
)
|
)
|
||||||
self.tmpCommunityIdForChannelsPermisisons = ""
|
self.tmpCommunityIdForChannelsPermisisons = ""
|
||||||
|
|
||||||
|
self.events.on(SIGNAL_COMMUNITY_MEMBER_REVEALED_ACCOUNTS_LOADED) do(e: Args):
|
||||||
|
let args = CommunityMemberRevealedAccountsArgs(e)
|
||||||
|
if self.tmpCommunityIdForRevealedAccounts == args.communityId:
|
||||||
|
self.delegate.onCommunityMemberRevealedAccountsLoaded(
|
||||||
|
args.communityId,
|
||||||
|
args.memberPubkey,
|
||||||
|
args.memberRevealedAccounts,
|
||||||
|
)
|
||||||
|
self.tmpCommunityIdForRevealedAccounts = ""
|
||||||
|
|
||||||
self.events.on(SignalType.Wallet.event, proc(e: Args) =
|
self.events.on(SignalType.Wallet.event, proc(e: Args) =
|
||||||
var data = WalletSignal(e)
|
var data = WalletSignal(e)
|
||||||
if data.eventType == backend_collectibles.eventCollectiblesOwnershipUpdateFinished:
|
if data.eventType == backend_collectibles.eventCollectiblesOwnershipUpdateFinished:
|
||||||
|
@ -432,3 +444,7 @@ proc asyncCheckPermissionsToJoin*(self: Controller, communityId: string, address
|
||||||
proc asyncCheckAllChannelsPermissions*(self: Controller, communityId: string, sharedAddresses: seq[string]) =
|
proc asyncCheckAllChannelsPermissions*(self: Controller, communityId: string, sharedAddresses: seq[string]) =
|
||||||
self.tmpCommunityIdForChannelsPermisisons = communityId
|
self.tmpCommunityIdForChannelsPermisisons = communityId
|
||||||
self.chatService.asyncCheckAllChannelsPermissions(communityId, sharedAddresses)
|
self.chatService.asyncCheckAllChannelsPermissions(communityId, sharedAddresses)
|
||||||
|
|
||||||
|
proc asyncGetRevealedAccountsForMember*(self: Controller, communityId, memberPubkey: string) =
|
||||||
|
self.tmpCommunityIdForRevealedAccounts = communityId
|
||||||
|
self.communityService.asyncGetRevealedAccountsForMember(communityId, memberPubkey)
|
||||||
|
|
|
@ -223,3 +223,7 @@ method onCommunityCheckPermissionsToJoinFailed*(self: AccessInterface, community
|
||||||
|
|
||||||
method onCommunityCheckAllChannelPermissionsFailed*(self: AccessInterface, communityId: string, ValueErrorerror: string) {.base.} =
|
method onCommunityCheckAllChannelPermissionsFailed*(self: AccessInterface, communityId: string, ValueErrorerror: string) {.base.} =
|
||||||
raise newException(ValueError, "No implementation available")
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
||||||
|
method onCommunityMemberRevealedAccountsLoaded*(self: AccessInterface, communityId: string, memberPubkey: string,
|
||||||
|
revealedAccounts: seq[RevealedAccount]) {.base.} =
|
||||||
|
raise newException(ValueError, "No implementation available")
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
import NimQml, sequtils, tables, stint, chronicles
|
import NimQml, sequtils, tables, stint, chronicles, json
|
||||||
|
|
||||||
import ./io_interface
|
import ./io_interface
|
||||||
import ../io_interface as delegate_interface
|
import ../io_interface as delegate_interface
|
||||||
|
@ -548,6 +548,8 @@ method checkPermissions*(self: Module, communityId: string, sharedAddresses: seq
|
||||||
self.view.setCheckingPermissionsInProgress(inProgress = true)
|
self.view.setCheckingPermissionsInProgress(inProgress = true)
|
||||||
|
|
||||||
method prepareTokenModelForCommunity*(self: Module, communityId: string) =
|
method prepareTokenModelForCommunity*(self: Module, communityId: string) =
|
||||||
|
self.controller.asyncGetRevealedAccountsForMember(communityId, singletonInstance.userProfile.getPubKey())
|
||||||
|
|
||||||
let community = self.controller.getCommunityById(communityId)
|
let community = self.controller.getCommunityById(communityId)
|
||||||
var tokenPermissionsItems: seq[TokenPermissionItem] = @[]
|
var tokenPermissionsItems: seq[TokenPermissionItem] = @[]
|
||||||
|
|
||||||
|
@ -635,3 +637,15 @@ method onCommunityCheckAllChannelsPermissionsResponse*(self: Module, communityId
|
||||||
communityId,
|
communityId,
|
||||||
channelPermissionResponse.viewAndPostPermissions.permissions,
|
channelPermissionResponse.viewAndPostPermissions.permissions,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
method onCommunityMemberRevealedAccountsLoaded*(self: Module, communityId, memberPubkey: string,
|
||||||
|
revealedAccounts: seq[RevealedAccount]) =
|
||||||
|
if memberPubkey == singletonInstance.userProfile.getPubKey():
|
||||||
|
var addresses: seq[string] = @[]
|
||||||
|
var airdropAddress = ""
|
||||||
|
for revealedAccount in revealedAccounts:
|
||||||
|
addresses.add(revealedAccount.address)
|
||||||
|
if revealedAccount.isAirdropAddress:
|
||||||
|
airdropAddress = revealedAccount.address
|
||||||
|
|
||||||
|
self.view.setMyRevealedAddressesForCurrentCommunity($(%*addresses), airdropAddress)
|
||||||
|
|
|
@ -51,6 +51,8 @@ QtObject:
|
||||||
discordImportHasCommunityImage: bool
|
discordImportHasCommunityImage: bool
|
||||||
downloadingCommunityHistoryArchives: bool
|
downloadingCommunityHistoryArchives: bool
|
||||||
checkingPermissionsInProgress: bool
|
checkingPermissionsInProgress: bool
|
||||||
|
myRevealedAddressesStringForCurrentCommunity: string
|
||||||
|
myRevealedAirdropAddressForCurrentCommunity: string
|
||||||
|
|
||||||
proc delete*(self: View) =
|
proc delete*(self: View) =
|
||||||
self.model.delete
|
self.model.delete
|
||||||
|
@ -671,6 +673,28 @@ QtObject:
|
||||||
proc getCommunityPublicKeyFromPrivateKey*(self: View, communityPrivateKey: string): string {.slot.} =
|
proc getCommunityPublicKeyFromPrivateKey*(self: View, communityPrivateKey: string): string {.slot.} =
|
||||||
result = self.delegate.getCommunityPublicKeyFromPrivateKey(communityPrivateKey)
|
result = self.delegate.getCommunityPublicKeyFromPrivateKey(communityPrivateKey)
|
||||||
|
|
||||||
|
proc myRevealedAirdropAddressesForCurrentCommunityChanged*(self: View) {.signal.}
|
||||||
|
|
||||||
|
proc setMyRevealedAddressesForCurrentCommunity*(self: View, revealedAddress, airdropAddress: string) =
|
||||||
|
self.myRevealedAddressesStringForCurrentCommunity = revealedAddress
|
||||||
|
self.myRevealedAirdropAddressForCurrentCommunity = airdropAddress
|
||||||
|
self.myRevealedAirdropAddressesForCurrentCommunityChanged()
|
||||||
|
|
||||||
|
proc getMyRevealedAddressesStringForCurrentCommunity*(self: View): string {.slot.} =
|
||||||
|
return self.myRevealedAddressesStringForCurrentCommunity
|
||||||
|
|
||||||
|
QtProperty[string] myRevealedAddressesStringForCurrentCommunity:
|
||||||
|
read = getMyRevealedAddressesStringForCurrentCommunity
|
||||||
|
notify = myRevealedAirdropAddressesForCurrentCommunityChanged
|
||||||
|
|
||||||
|
|
||||||
|
proc getMyRevealedAirdropAddressStringForCurrentCommunity*(self: View): string {.slot.} =
|
||||||
|
return self.myRevealedAirdropAddressForCurrentCommunity
|
||||||
|
|
||||||
|
QtProperty[string] myRevealedAirdropAddressForCurrentCommunity:
|
||||||
|
read = getMyRevealedAirdropAddressStringForCurrentCommunity
|
||||||
|
notify = myRevealedAirdropAddressesForCurrentCommunityChanged
|
||||||
|
|
||||||
proc checkingPermissionsInProgressChanged*(self: View) {.signal.}
|
proc checkingPermissionsInProgressChanged*(self: View) {.signal.}
|
||||||
|
|
||||||
proc setCheckingPermissionsInProgress*(self: View, inProgress: bool) =
|
proc setCheckingPermissionsInProgress*(self: View, inProgress: bool) =
|
||||||
|
|
|
@ -188,11 +188,29 @@ const asyncImportCommunityTask: Task = proc(argEncoded: string) {.gcsafe, nimcal
|
||||||
})
|
})
|
||||||
|
|
||||||
type
|
type
|
||||||
AsyncGetRevealedAccountsForAllMembersArg = ref object of QObjectTaskArg
|
AsyncGetRevealedAccountsArg = ref object of QObjectTaskArg
|
||||||
communityId: string
|
communityId: string
|
||||||
|
memberPubkey: string
|
||||||
|
|
||||||
|
const asyncGetRevealedAccountsForMemberTask: Task = proc(argEncoded: string) {.gcsafe, nimcall.} =
|
||||||
|
let arg = decode[AsyncGetRevealedAccountsArg](argEncoded)
|
||||||
|
try:
|
||||||
|
let response = status_go.getRevealedAccountsForMember(arg.communityId, arg.memberPubkey)
|
||||||
|
arg.finish(%* {
|
||||||
|
"communityId": arg.communityId,
|
||||||
|
"memberPubkey": arg.memberPubkey,
|
||||||
|
"response": response,
|
||||||
|
"error": "",
|
||||||
|
})
|
||||||
|
except Exception as e:
|
||||||
|
arg.finish(%* {
|
||||||
|
"communityId": arg.communityId,
|
||||||
|
"memberPubkey": arg.memberPubkey,
|
||||||
|
"error": e.msg,
|
||||||
|
})
|
||||||
|
|
||||||
const asyncGetRevealedAccountsForAllMembersTask: Task = proc(argEncoded: string) {.gcsafe, nimcall.} =
|
const asyncGetRevealedAccountsForAllMembersTask: Task = proc(argEncoded: string) {.gcsafe, nimcall.} =
|
||||||
let arg = decode[AsyncGetRevealedAccountsForAllMembersArg](argEncoded)
|
let arg = decode[AsyncGetRevealedAccountsArg](argEncoded)
|
||||||
try:
|
try:
|
||||||
let response = status_go.getRevealedAccountsForAllMembers(arg.communityId)
|
let response = status_go.getRevealedAccountsForAllMembers(arg.communityId)
|
||||||
arg.finish(%* {
|
arg.finish(%* {
|
||||||
|
|
|
@ -129,6 +129,11 @@ type
|
||||||
communityId*: string
|
communityId*: string
|
||||||
metricsType*: CommunityMetricsType
|
metricsType*: CommunityMetricsType
|
||||||
|
|
||||||
|
CommunityMemberRevealedAccountsArgs* = ref object of Args
|
||||||
|
communityId*: string
|
||||||
|
memberPubkey*: string
|
||||||
|
memberRevealedAccounts*: seq[RevealedAccount]
|
||||||
|
|
||||||
CommunityMembersRevealedAccountsArgs* = ref object of Args
|
CommunityMembersRevealedAccountsArgs* = ref object of Args
|
||||||
communityId*: string
|
communityId*: string
|
||||||
membersRevealedAccounts*: MembersRevealedAccounts
|
membersRevealedAccounts*: MembersRevealedAccounts
|
||||||
|
@ -141,6 +146,7 @@ const SIGNAL_COMMUNITY_MY_REQUEST_ADDED* = "communityMyRequestAdded"
|
||||||
const SIGNAL_COMMUNITY_MY_REQUEST_FAILED* = "communityMyRequestFailed"
|
const SIGNAL_COMMUNITY_MY_REQUEST_FAILED* = "communityMyRequestFailed"
|
||||||
const SIGNAL_COMMUNITY_EDIT_SHARED_ADDRESSES_SUCCEEDED* = "communityEditSharedAddressesSucceded"
|
const SIGNAL_COMMUNITY_EDIT_SHARED_ADDRESSES_SUCCEEDED* = "communityEditSharedAddressesSucceded"
|
||||||
const SIGNAL_COMMUNITY_EDIT_SHARED_ADDRESSES_FAILED* = "communityEditSharedAddressesFailed"
|
const SIGNAL_COMMUNITY_EDIT_SHARED_ADDRESSES_FAILED* = "communityEditSharedAddressesFailed"
|
||||||
|
const SIGNAL_COMMUNITY_MEMBER_REVEALED_ACCOUNTS_LOADED* = "communityMemberRevealedAccountsLoaded"
|
||||||
const SIGNAL_COMMUNITY_MEMBERS_REVEALED_ACCOUNTS_LOADED* = "communityMembersRevealedAccountsLoaded"
|
const SIGNAL_COMMUNITY_MEMBERS_REVEALED_ACCOUNTS_LOADED* = "communityMembersRevealedAccountsLoaded"
|
||||||
const SIGNAL_COMMUNITY_LEFT* = "communityLeft"
|
const SIGNAL_COMMUNITY_LEFT* = "communityLeft"
|
||||||
const SIGNAL_COMMUNITY_CREATED* = "communityCreated"
|
const SIGNAL_COMMUNITY_CREATED* = "communityCreated"
|
||||||
|
@ -2052,8 +2058,39 @@ QtObject:
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
error "error while getting community public key", msg = e.msg
|
error "error while getting community public key", msg = e.msg
|
||||||
|
|
||||||
|
proc asyncGetRevealedAccountsForMember*(self: Service, communityId, memberPubkey: string) =
|
||||||
|
let arg = AsyncGetRevealedAccountsArg(
|
||||||
|
tptr: cast[ByteAddress](asyncGetRevealedAccountsForMemberTask),
|
||||||
|
vptr: cast[ByteAddress](self.vptr),
|
||||||
|
slot: "onAsyncGetRevealedAccountsForMemberCompleted",
|
||||||
|
communityId: communityId,
|
||||||
|
memberPubkey: memberPubkey,
|
||||||
|
)
|
||||||
|
self.threadpool.start(arg)
|
||||||
|
|
||||||
|
proc onAsyncGetRevealedAccountsForMemberCompleted*(self: Service, response: string) {.slot.} =
|
||||||
|
try:
|
||||||
|
let rpcResponseObj = response.parseJson
|
||||||
|
|
||||||
|
if rpcResponseObj{"error"}.kind != JNull and rpcResponseObj{"error"}.getStr != "":
|
||||||
|
raise newException(RpcException, rpcResponseObj["error"].getStr)
|
||||||
|
|
||||||
|
if rpcResponseObj["response"]{"error"}.kind != JNull:
|
||||||
|
let error = Json.decode(rpcResponseObj["response"]["error"].getStr, RpcError)
|
||||||
|
raise newException(RpcException, error.message)
|
||||||
|
|
||||||
|
let revealedAccounts = rpcResponseObj["response"]["result"].toRevealedAccounts()
|
||||||
|
|
||||||
|
self.events.emit(SIGNAL_COMMUNITY_MEMBER_REVEALED_ACCOUNTS_LOADED, CommunityMemberRevealedAccountsArgs(
|
||||||
|
communityId: rpcResponseObj["communityId"].getStr,
|
||||||
|
memberPubkey: rpcResponseObj["memberPubkey"].getStr,
|
||||||
|
memberRevealedAccounts: revealedAccounts,
|
||||||
|
))
|
||||||
|
except Exception as e:
|
||||||
|
error "error while getting the community members' revealed addressesses", msg = e.msg
|
||||||
|
|
||||||
proc asyncGetRevealedAccountsForAllMembers*(self: Service, communityId: string) =
|
proc asyncGetRevealedAccountsForAllMembers*(self: Service, communityId: string) =
|
||||||
let arg = AsyncGetRevealedAccountsForAllMembersArg(
|
let arg = AsyncGetRevealedAccountsArg(
|
||||||
tptr: cast[ByteAddress](asyncGetRevealedAccountsForAllMembersTask),
|
tptr: cast[ByteAddress](asyncGetRevealedAccountsForAllMembersTask),
|
||||||
vptr: cast[ByteAddress](self.vptr),
|
vptr: cast[ByteAddress](self.vptr),
|
||||||
slot: "onAsyncGetRevealedAccountsForAllMembersCompleted",
|
slot: "onAsyncGetRevealedAccountsForAllMembersCompleted",
|
||||||
|
@ -2082,7 +2119,7 @@ QtObject:
|
||||||
error "error while getting the community members' revealed addressesses", msg = e.msg
|
error "error while getting the community members' revealed addressesses", msg = e.msg
|
||||||
|
|
||||||
proc asyncReevaluateCommunityMembersPermissions*(self: Service, communityId: string) =
|
proc asyncReevaluateCommunityMembersPermissions*(self: Service, communityId: string) =
|
||||||
let arg = AsyncGetRevealedAccountsForAllMembersArg(
|
let arg = AsyncGetRevealedAccountsArg(
|
||||||
tptr: cast[ByteAddress](asyncReevaluateCommunityMembersPermissionsTask),
|
tptr: cast[ByteAddress](asyncReevaluateCommunityMembersPermissionsTask),
|
||||||
vptr: cast[ByteAddress](self.vptr),
|
vptr: cast[ByteAddress](self.vptr),
|
||||||
slot: "onAsyncReevaluateCommunityMembersPermissionsCompleted",
|
slot: "onAsyncReevaluateCommunityMembersPermissionsCompleted",
|
||||||
|
|
|
@ -49,6 +49,9 @@ StatusListView {
|
||||||
|
|
||||||
spacing: Style.current.halfPadding
|
spacing: Style.current.halfPadding
|
||||||
delegate: StatusListItem {
|
delegate: StatusListItem {
|
||||||
|
readonly property string address: model.address.toLowerCase()
|
||||||
|
|
||||||
|
id: listItem
|
||||||
width: ListView.view.width - ListView.view.leftMargin - ListView.view.rightMargin
|
width: ListView.view.width - ListView.view.leftMargin - ListView.view.rightMargin
|
||||||
statusListItemTitle.font.weight: Font.Medium
|
statusListItemTitle.font.weight: Font.Medium
|
||||||
title: model.name
|
title: model.name
|
||||||
|
@ -102,11 +105,11 @@ StatusListView {
|
||||||
icon.color: hovered ? Theme.palette.primaryColor3 :
|
icon.color: hovered ? Theme.palette.primaryColor3 :
|
||||||
checked ? Theme.palette.primaryColor1 : disabledTextColor
|
checked ? Theme.palette.primaryColor1 : disabledTextColor
|
||||||
checkable: true
|
checkable: true
|
||||||
checked: model.address === root.selectedAirdropAddress
|
checked: listItem.address === root.selectedAirdropAddress
|
||||||
enabled: shareAddressCheckbox.checked && root.selectedSharedAddresses.length > 1 // last cannot be unchecked
|
enabled: shareAddressCheckbox.checked && root.selectedSharedAddresses.length > 1 // last cannot be unchecked
|
||||||
visible: shareAddressCheckbox.checked
|
visible: shareAddressCheckbox.checked
|
||||||
opacity: enabled ? 1.0 : 0.3
|
opacity: enabled ? 1.0 : 0.3
|
||||||
onCheckedChanged: if (checked) root.selectedAirdropAddress = model.address
|
onCheckedChanged: if (checked) root.selectedAirdropAddress = listItem.address
|
||||||
onToggled: root.addressesChanged()
|
onToggled: root.addressesChanged()
|
||||||
|
|
||||||
StatusToolTip {
|
StatusToolTip {
|
||||||
|
@ -120,21 +123,21 @@ StatusListView {
|
||||||
ButtonGroup.group: d.addressesGroup
|
ButtonGroup.group: d.addressesGroup
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
checkable: true
|
checkable: true
|
||||||
checked: root.selectedSharedAddresses.includes(model.address)
|
checked: root.selectedSharedAddresses.includes(listItem.address)
|
||||||
enabled: !(root.selectedSharedAddresses.length === 1 && checked) // last cannot be unchecked
|
enabled: !(root.selectedSharedAddresses.length === 1 && checked) // last cannot be unchecked
|
||||||
onToggled: {
|
onToggled: {
|
||||||
// handle selected addresses
|
// handle selected addresses
|
||||||
const index = root.selectedSharedAddresses.indexOf(model.address)
|
const index = root.selectedSharedAddresses.indexOf(listItem.address)
|
||||||
const selectedSharedAddressesCopy = Object.assign([], root.selectedSharedAddresses) // deep copy
|
const selectedSharedAddressesCopy = Object.assign([], root.selectedSharedAddresses) // deep copy
|
||||||
if (index === -1) {
|
if (index === -1) {
|
||||||
selectedSharedAddressesCopy.push(model.address)
|
selectedSharedAddressesCopy.push(listItem.address)
|
||||||
} else {
|
} else {
|
||||||
selectedSharedAddressesCopy.splice(index, 1)
|
selectedSharedAddressesCopy.splice(index, 1)
|
||||||
}
|
}
|
||||||
root.selectedSharedAddresses = selectedSharedAddressesCopy
|
root.selectedSharedAddresses = selectedSharedAddressesCopy
|
||||||
|
|
||||||
// switch to next available airdrop address when unchecking
|
// switch to next available airdrop address when unchecking
|
||||||
if (!checked && model.address === root.selectedAirdropAddress) {
|
if (!checked && listItem.address === root.selectedAirdropAddress) {
|
||||||
d.selectFirstAvailableAirdropAddress()
|
d.selectFirstAvailableAirdropAddress()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -116,6 +116,15 @@ Control {
|
||||||
root.selectedAirdropAddress = accountSelector.selectedAirdropAddress
|
root.selectedAirdropAddress = accountSelector.selectedAirdropAddress
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function setOldSharedAddresses(oldSharedAddresses) {
|
||||||
|
d.initialSelectedSharedAddresses = oldSharedAddresses
|
||||||
|
}
|
||||||
|
|
||||||
|
function setOldAirdropAddress(oldAirdropAddress) {
|
||||||
|
d.initialSelectedAirdropAddress = oldAirdropAddress
|
||||||
|
accountSelector.selectedAirdropAddress = oldAirdropAddress
|
||||||
|
}
|
||||||
|
|
||||||
SortFilterProxyModel {
|
SortFilterProxyModel {
|
||||||
id: filteredAccountsModel
|
id: filteredAccountsModel
|
||||||
sourceModel: root.walletAccountsModel
|
sourceModel: root.walletAccountsModel
|
||||||
|
|
|
@ -29,6 +29,14 @@ StatusDialog {
|
||||||
signal saveSelectedAddressesClicked(string airdropAddress, var sharedAddresses)
|
signal saveSelectedAddressesClicked(string airdropAddress, var sharedAddresses)
|
||||||
signal sharedAddressesChanged(string airdropAddress, var sharedAddresses)
|
signal sharedAddressesChanged(string airdropAddress, var sharedAddresses)
|
||||||
|
|
||||||
|
function setOldSharedAddresses(oldSharedAddresses) {
|
||||||
|
panel.setOldSharedAddresses(oldSharedAddresses)
|
||||||
|
}
|
||||||
|
|
||||||
|
function setOldAirdropAddress(oldAirdropAddress) {
|
||||||
|
panel.setOldAirdropAddress(oldAirdropAddress)
|
||||||
|
}
|
||||||
|
|
||||||
title: panel.title
|
title: panel.title
|
||||||
implicitWidth: 640 // by design
|
implicitWidth: 640 // by design
|
||||||
padding: 0
|
padding: 0
|
||||||
|
|
|
@ -43,6 +43,20 @@ QtObject {
|
||||||
|
|
||||||
readonly property var permissionsModel: !!root.communitiesModuleInst.spectatedCommunityPermissionModel ?
|
readonly property var permissionsModel: !!root.communitiesModuleInst.spectatedCommunityPermissionModel ?
|
||||||
root.communitiesModuleInst.spectatedCommunityPermissionModel : null
|
root.communitiesModuleInst.spectatedCommunityPermissionModel : null
|
||||||
|
|
||||||
|
readonly property var myRevealedAddressesForCurrentCommunity: {
|
||||||
|
try {
|
||||||
|
let revealedAddresses = root.communitiesModuleInst.myRevealedAddressesStringForCurrentCommunity
|
||||||
|
let revealedAddressArray = JSON.parse(revealedAddresses)
|
||||||
|
return revealedAddressArray.map(addr => addr.toLowerCase())
|
||||||
|
} catch (e) {
|
||||||
|
console.error("Error parsing my revealed addresses", e)
|
||||||
|
}
|
||||||
|
return []
|
||||||
|
}
|
||||||
|
readonly property string myRevealedAirdropAddressForCurrentCommunity:
|
||||||
|
root.communitiesModuleInst.myRevealedAirdropAddressForCurrentCommunity.toLowerCase()
|
||||||
|
|
||||||
property var walletAccountsModel: WalletStore.RootStore.nonWatchAccounts
|
property var walletAccountsModel: WalletStore.RootStore.nonWatchAccounts
|
||||||
property var assetsModel: SortFilterProxyModel {
|
property var assetsModel: SortFilterProxyModel {
|
||||||
sourceModel: communitiesModuleInst.tokenList
|
sourceModel: communitiesModuleInst.tokenList
|
||||||
|
|
|
@ -697,6 +697,21 @@ QtObject {
|
||||||
SharedAddressesPopup {
|
SharedAddressesPopup {
|
||||||
id: editSharedAddressesPopup
|
id: editSharedAddressesPopup
|
||||||
|
|
||||||
|
readonly property var oldSharedAddresses: root.rootStore.myRevealedAddressesForCurrentCommunity
|
||||||
|
readonly property string oldAirdropAddress: root.rootStore.myRevealedAirdropAddressForCurrentCommunity
|
||||||
|
|
||||||
|
onOldSharedAddressesChanged: {
|
||||||
|
editSharedAddressesPopup.setOldSharedAddresses(
|
||||||
|
editSharedAddressesPopup.oldSharedAddresses
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
onOldAirdropAddressChanged: {
|
||||||
|
editSharedAddressesPopup.setOldAirdropAddress(
|
||||||
|
editSharedAddressesPopup.oldAirdropAddress
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
property string communityId
|
property string communityId
|
||||||
|
|
||||||
readonly property var chatStore: ChatStore.RootStore {
|
readonly property var chatStore: ChatStore.RootStore {
|
||||||
|
@ -710,9 +725,6 @@ QtObject {
|
||||||
communityName: chatStore.sectionDetails.name
|
communityName: chatStore.sectionDetails.name
|
||||||
communityIcon: chatStore.sectionDetails.image
|
communityIcon: chatStore.sectionDetails.image
|
||||||
requirementsCheckPending: root.rootStore.requirementsCheckPending
|
requirementsCheckPending: root.rootStore.requirementsCheckPending
|
||||||
// FIXME get these from the community settings (from the initial "join" call)
|
|
||||||
//selectedSharedAddresses: [???]
|
|
||||||
//selectedAirdropAddress: "???"
|
|
||||||
loginType: chatStore.loginType
|
loginType: chatStore.loginType
|
||||||
walletAccountsModel: root.rootStore.walletAccountsModel
|
walletAccountsModel: root.rootStore.walletAccountsModel
|
||||||
permissionsModel: {
|
permissionsModel: {
|
||||||
|
|
Loading…
Reference in New Issue