refactor: move all old usages of contacts to the new code

This commit is contained in:
Jonathan Rainville 2021-11-11 11:11:40 -05:00 committed by Sale Djenic
parent cb7865bd9e
commit e8eefd8f87
6 changed files with 13 additions and 10 deletions

View File

@ -132,7 +132,7 @@ QtObject:
self.endRemoveRows()
self.countChanged()
proc hasAddedContacts(self: ContactList): bool {.slot.} =
proc hasAddedContacts(self: ContactList): bool {.slot.} =
for c in self.contacts:
if(c.isContact()): return true
return false

View File

@ -27,7 +27,13 @@ StatusAppThreePanelLayout {
property var store
property var messageStore
// Not Refactored
// property var messageStore
// Not Refactored
property RootStore rootStore: RootStore {
messageStore: root.messageStore
}
property alias chatColumn: chatColumn
property bool stickersLoaded: false
@ -58,7 +64,7 @@ StatusAppThreePanelLayout {
centerPanel: ChatColumnView {
id: chatColumn
//rootStore: root.rootStore
rootStore: root.rootStore
chatGroupsListViewCount: contactColumnLoader.item.chatGroupsListViewCount
onOpenAppSearch: {
@ -100,7 +106,7 @@ StatusAppThreePanelLayout {
id: contactsColumnComponent
ContactsColumnView {
// Not Refactored
//store: root.rootStore
store: root.rootStore
onOpenProfileClicked: {
root.profileButtonClicked();
}
@ -123,7 +129,7 @@ StatusAppThreePanelLayout {
id: groupInfoPopupComponent
GroupInfoPopup {
// Not Refactored
//store: root.rootStore
store: root.rootStore
pinnedMessagesPopupComponent: chatColumn.pinnedMessagesPopupComponent
}
}
@ -155,7 +161,7 @@ StatusAppThreePanelLayout {
MessageContextMenuView {
id: quickActionMessageOptionsMenu
// Not Refactored
// store: root.rootStore
store: root.rootStore
// reactionModel: root.rootStore.emojiReactionsModel
}
}

View File

@ -162,7 +162,6 @@ Item {
Connections {
enabled: realChatType === Constants.chatTypeOneToOne
// TODO use a store once it is available
target: contactsModule.model.list
onContactChanged: {
if (pubkey === wrapper.chatId) {

View File

@ -107,7 +107,6 @@ StatusModal {
Component {
id: membersList
CommunityProfilePopupMembersListPanel {
// TODO assign the store on open
store: root.store
width: stack.width
//% "Members"

View File

@ -61,7 +61,6 @@ ListView {
BlockContactConfirmationDialog {
id: blockContactConfirmationDialog
onBlockButtonClicked: {
// TODO use a store once it is available
contactsModule.blockContact(blockContactConfirmationDialog.contactAddress)
blockContactConfirmationDialog.close()
}
@ -75,7 +74,6 @@ ListView {
//% "Are you sure you want to remove this contact?"
confirmationText: qsTrId("are-you-sure-you-want-to-remove-this-contact-")
onConfirmButtonClicked: {
// TODO use a store once it is available
if (contactsModule.model.isAdded(removeContactConfirmationDialog.value)) {
contactsModule.removeContact(removeContactConfirmationDialog.value);
}

View File

@ -20,6 +20,7 @@ ListView {
property Component profilePopupComponent: ProfilePopup {
id: profilePopup
store: contactList.store
onClosed: destroy()
}