refactor(@desktop/general): many errors from the log are fixed
- various issues on app start in console - various issues when logging out in console - `node_section` module delete method error - SyntaxError: JSON.parse: Parse error from the MessageStore
This commit is contained in:
parent
4cb3126513
commit
f0ca1a4cc3
|
@ -207,6 +207,7 @@ proc newAppController*(statusFoundation: StatusFoundation): AppController =
|
|||
result.connect()
|
||||
|
||||
proc delete*(self: AppController) =
|
||||
singletonInstance.delete
|
||||
self.osNotificationService.delete
|
||||
self.keychainService.delete
|
||||
self.contactsService.delete
|
||||
|
|
|
@ -34,7 +34,7 @@ proc newController*(delegate: io_interface.AccessInterface,
|
|||
result.nodeService = nodeService
|
||||
result.nodeConfigurationService = nodeConfigurationService
|
||||
|
||||
proc delete*(self: Controller) =
|
||||
method delete*(self: Controller) =
|
||||
discard
|
||||
|
||||
proc setPeers(self: Controller, peers: seq[string]) =
|
||||
|
|
|
@ -33,7 +33,7 @@ import shared.panels 1.0
|
|||
Rectangle {
|
||||
id: container
|
||||
|
||||
property QtObject model: undefined
|
||||
property QtObject model
|
||||
property Item delegate
|
||||
property alias suggestionsModel: filterItem.model
|
||||
property alias filter: filterItem.filter
|
||||
|
|
|
@ -5,7 +5,13 @@ QtObject {
|
|||
id: root
|
||||
|
||||
property var messageModule
|
||||
property var messagesModel: messageModule.model
|
||||
property var messagesModel
|
||||
|
||||
onMessageModuleChanged: {
|
||||
if(!messageModule)
|
||||
return
|
||||
root.messagesModel = messageModule.model
|
||||
}
|
||||
|
||||
function loadMoreMessages () {
|
||||
if(!messageModule)
|
||||
|
@ -21,6 +27,9 @@ QtObject {
|
|||
return false
|
||||
|
||||
let jsonObj = messageModule.getMessageByIdAsJson(id)
|
||||
if(jsonObj === "")
|
||||
return
|
||||
|
||||
let obj = JSON.parse(jsonObj)
|
||||
if (obj.error) {
|
||||
// This log is available only in debug mode, if it's annoying we can remove it
|
||||
|
@ -36,6 +45,9 @@ QtObject {
|
|||
return false
|
||||
|
||||
let jsonObj = messageModule.getMessageByIndexAsJson(index)
|
||||
if(jsonObj === "")
|
||||
return
|
||||
|
||||
let obj = JSON.parse(jsonObj)
|
||||
if (obj.error) {
|
||||
// This log is available only in debug mode, if it's annoying we can remove it
|
||||
|
|
|
@ -67,8 +67,6 @@ QtObject {
|
|||
|
||||
property var userProfileInst: userProfile
|
||||
|
||||
property bool isDebugEnabled: profileSectionModule.isDebugEnabled
|
||||
|
||||
property var accounts: walletSectionAccounts.model
|
||||
property var currentAccount: walletSectionCurrent
|
||||
property var currentCurrency: walletSection.currentCurrency
|
||||
|
|
|
@ -52,9 +52,9 @@ Item {
|
|||
property Timer timer: Timer { }
|
||||
property var userList
|
||||
|
||||
property var contactDetails: Utils.getContactDetailsAsJson(publicKey)
|
||||
property bool isBlocked: root.contactDetails.isContact
|
||||
property bool isContact: root.contactDetails.isBlocked
|
||||
property var contactDetails: Utils.getContactDetailsAsJson(root.activeChatId)
|
||||
property bool isBlocked: root.contactDetails.isBlocked
|
||||
property bool isContact: root.contactDetails.isContact
|
||||
property bool contactRequestReceived: root.contactDetails.requestReceived
|
||||
|
||||
signal openAppSearch()
|
||||
|
@ -172,10 +172,6 @@ Item {
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
// Should never be here, correct index must be returned from the `for` loop above
|
||||
console.error("Wrong chat/channel index, active item id: ", root.activeChatId,
|
||||
" active subitem id: ", root.activeSubItemId)
|
||||
}
|
||||
|
||||
return 0
|
||||
|
|
|
@ -42,8 +42,11 @@ ColumnLayout {
|
|||
id: topBar
|
||||
Layout.fillWidth: true
|
||||
|
||||
chatInfoButton.title: chatContentModule.chatDetails.name
|
||||
chatInfoButton.title: chatContentModule? chatContentModule.chatDetails.name : ""
|
||||
chatInfoButton.subTitle: {
|
||||
if(!chatContentModule)
|
||||
return ""
|
||||
|
||||
// In some moment in future this should be part of the backend logic.
|
||||
// (once we add transaltion on the backend side)
|
||||
switch (chatContentModule.chatDetails.type) {
|
||||
|
@ -68,24 +71,39 @@ ColumnLayout {
|
|||
return ""
|
||||
}
|
||||
}
|
||||
chatInfoButton.image.source: chatContentModule.chatDetails.icon
|
||||
chatInfoButton.image.isIdenticon: chatContentModule.chatDetails.isIdenticon
|
||||
chatInfoButton.icon.color: chatContentModule.chatDetails.color
|
||||
chatInfoButton.type: chatContentModule.chatDetails.type
|
||||
chatInfoButton.pinnedMessagesCount: chatContentModule.pinnedMessagesModel.count
|
||||
chatInfoButton.muted: chatContentModule.chatDetails.muted
|
||||
chatInfoButton.image.source: chatContentModule? chatContentModule.chatDetails.icon : ""
|
||||
chatInfoButton.image.isIdenticon: chatContentModule? chatContentModule.chatDetails.isIdenticon : false
|
||||
chatInfoButton.icon.color: chatContentModule? chatContentModule.chatDetails.color : ""
|
||||
chatInfoButton.type: chatContentModule? chatContentModule.chatDetails.type : Constants.chatType.unknown
|
||||
chatInfoButton.pinnedMessagesCount: chatContentModule? chatContentModule.pinnedMessagesModel.count : 0
|
||||
chatInfoButton.muted: chatContentModule? chatContentModule.chatDetails.muted : false
|
||||
|
||||
chatInfoButton.onPinnedMessagesCountClicked: {
|
||||
if(!chatContentModule) {
|
||||
console.debug("error on open pinned messages - chat content module is not set")
|
||||
return
|
||||
}
|
||||
Global.openPopup(pinnedMessagesPopupComponent, {
|
||||
messageStore: messageStore,
|
||||
pinnedMessagesModel: chatContentModule.pinnedMessagesModel,
|
||||
messageToPin: ""
|
||||
})
|
||||
}
|
||||
chatInfoButton.onUnmute: chatContentModule.unmuteChat()
|
||||
chatInfoButton.onUnmute: {
|
||||
if(!chatContentModule) {
|
||||
console.debug("error on unmute chat - chat content module is not set")
|
||||
return
|
||||
}
|
||||
chatContentModule.unmuteChat()
|
||||
}
|
||||
|
||||
chatInfoButton.sensor.enabled: chatContentModule.chatDetails.type !== Constants.chatType.publicChat &&
|
||||
chatContentModule.chatDetails.type !== Constants.chatType.communityChat
|
||||
chatInfoButton.sensor.enabled: {
|
||||
if(!chatContentModule)
|
||||
return false
|
||||
|
||||
return chatContentModule.chatDetails.type !== Constants.chatType.publicChat &&
|
||||
chatContentModule.chatDetails.type !== Constants.chatType.communityChat
|
||||
}
|
||||
chatInfoButton.onClicked: {
|
||||
// Not Refactored Yet
|
||||
// switch (chatContentRoot.rootStore.chatsModelInst.channelView.activeChannel.chatType) {
|
||||
|
@ -101,12 +119,23 @@ ColumnLayout {
|
|||
// }
|
||||
}
|
||||
|
||||
membersButton.visible: localAccountSensitiveSettings.showOnlineUsers && chatContentModule.chatDetails.isUsersListAvailable
|
||||
membersButton.visible: {
|
||||
if(!chatContentModule)
|
||||
return false
|
||||
|
||||
return localAccountSensitiveSettings.showOnlineUsers &&
|
||||
chatContentModule.chatDetails.isUsersListAvailable
|
||||
}
|
||||
membersButton.highlighted: localAccountSensitiveSettings.expandUsersList
|
||||
notificationButton.visible: localAccountSensitiveSettings.isActivityCenterEnabled
|
||||
notificationButton.tooltip.offset: localAccountSensitiveSettings.expandUsersList ? 0 : 14
|
||||
|
||||
notificationCount: chatContentModule.chatDetails.notificationCount
|
||||
notificationCount: {
|
||||
if(!chatContentModule)
|
||||
return 0
|
||||
|
||||
return chatContentModule.chatDetails.notificationCount
|
||||
}
|
||||
|
||||
onSearchButtonClicked: root.openAppSearch()
|
||||
|
||||
|
@ -115,6 +144,10 @@ ColumnLayout {
|
|||
|
||||
popupMenu: ChatContextMenuView {
|
||||
openHandler: function () {
|
||||
if(!chatContentModule) {
|
||||
console.debug("error on open chat context menu handler - chat content module is not set")
|
||||
return
|
||||
}
|
||||
currentFleet = chatContentModule.getCurrentFleet()
|
||||
isCommunityChat = chatContentModule.chatDetails.belongsToCommunity
|
||||
amIChatAdmin = chatContentModule.amIChatAdmin()
|
||||
|
@ -126,18 +159,34 @@ ColumnLayout {
|
|||
}
|
||||
|
||||
onMuteChat: {
|
||||
if(!chatContentModule) {
|
||||
console.debug("error on mute chat from context menu - chat content module is not set")
|
||||
return
|
||||
}
|
||||
chatContentModule.muteChat()
|
||||
}
|
||||
|
||||
onUnmuteChat: {
|
||||
if(!chatContentModule) {
|
||||
console.debug("error on unmute chat from context menu - chat content module is not set")
|
||||
return
|
||||
}
|
||||
chatContentModule.unmuteChat()
|
||||
}
|
||||
|
||||
onMarkAllMessagesRead: {
|
||||
if(!chatContentModule) {
|
||||
console.debug("error on mark all messages read from context menu - chat content module is not set")
|
||||
return
|
||||
}
|
||||
chatContentModule.markAllMessagesRead()
|
||||
}
|
||||
|
||||
onClearChatHistory: {
|
||||
if(!chatContentModule) {
|
||||
console.debug("error on clear chat history from context menu - chat content module is not set")
|
||||
return
|
||||
}
|
||||
chatContentModule.clearChatHistory()
|
||||
}
|
||||
|
||||
|
@ -146,6 +195,10 @@ ColumnLayout {
|
|||
}
|
||||
|
||||
onLeaveChat: {
|
||||
if(!chatContentModule) {
|
||||
console.debug("error on leave chat from context menu - chat content module is not set")
|
||||
return
|
||||
}
|
||||
chatContentModule.leaveChat()
|
||||
}
|
||||
|
||||
|
@ -170,6 +223,10 @@ ColumnLayout {
|
|||
}
|
||||
|
||||
onOpenPinnedMessagesList: {
|
||||
if(!chatContentModule) {
|
||||
console.debug("error on open pinned messages from context menu - chat content module is not set")
|
||||
return
|
||||
}
|
||||
Global.openPopup(pinnedMessagesPopupComponent, {
|
||||
messageStore: messageStore,
|
||||
pinnedMessagesModel: chatContentModule.pinnedMessagesModel,
|
||||
|
@ -245,7 +302,7 @@ ColumnLayout {
|
|||
|
||||
MessageStore{
|
||||
id: messageStore
|
||||
messageModule: chatContentModule.messagesModule
|
||||
messageModule: chatContentModule? chatContentModule.messagesModule : null
|
||||
}
|
||||
|
||||
MessageContextMenuView {
|
||||
|
@ -260,6 +317,10 @@ ColumnLayout {
|
|||
}
|
||||
|
||||
onPinnedMessagesLimitReached: {
|
||||
if(!chatContentModule) {
|
||||
console.debug("error on open pinned messages limit reached from message context menu - chat content module is not set")
|
||||
return
|
||||
}
|
||||
Global.openPopup(pinnedMessagesPopupComponent, {
|
||||
messageStore: messageStore,
|
||||
pinnedMessagesModel: chatContentModule.pinnedMessagesModel,
|
||||
|
@ -355,8 +416,13 @@ ColumnLayout {
|
|||
anchors.bottom: parent.bottom
|
||||
recentStickers: chatContentRoot.rootStore.stickersModuleInst.recent
|
||||
stickerPackList: chatContentRoot.rootStore.stickersModuleInst.stickerPacks
|
||||
chatType: chatContentModule.chatDetails.type
|
||||
chatType: chatContentModule? chatContentModule.chatDetails.type : Constants.chatType.unknown
|
||||
onSendTransactionCommandButtonClicked: {
|
||||
if(!chatContentModule) {
|
||||
console.debug("error on sending transaction command - chat content module is not set")
|
||||
return
|
||||
}
|
||||
|
||||
if (Utils.getContactDetailsAsJson(chatContentModule.getMyChatId()).ensVerified) {
|
||||
Global.openPopup(chatContentRoot.sendTransactionWithEnsModal)
|
||||
} else {
|
||||
|
@ -373,6 +439,11 @@ ColumnLayout {
|
|||
packId)
|
||||
}
|
||||
onSendMessage: {
|
||||
if(!chatContentModule) {
|
||||
console.debug("error on sending message - chat content module is not set")
|
||||
return
|
||||
}
|
||||
|
||||
if (chatInput.fileUrls.length > 0){
|
||||
chatContentModule.inputAreaModule.sendImages(JSON.stringify(fileUrls));
|
||||
}
|
||||
|
|
|
@ -39,14 +39,14 @@ Item {
|
|||
|
||||
Item {
|
||||
id: loadingMessagesIndicator
|
||||
visible: messageStore.messageModule.loadingHistoryMessagesInProgress
|
||||
visible: messageStore.messageModule? messageStore.messageModule.loadingHistoryMessagesInProgress : false
|
||||
anchors.top: parent.top
|
||||
anchors.left: parent.left
|
||||
height: visible? 20 : 0
|
||||
width: parent.width
|
||||
|
||||
Loader {
|
||||
active: messageStore.messageModule.loadingHistoryMessagesInProgress
|
||||
active: messageStore.messageModule? messageStore.messageModule.loadingHistoryMessagesInProgress : false
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
sourceComponent: Component {
|
||||
|
|
|
@ -94,6 +94,9 @@ Item {
|
|||
// TODO: replace with StatusTextArea once it lives in StatusQ.
|
||||
StyledTextArea {
|
||||
id: mailserverLogTxt
|
||||
Layout.rightMargin: Style.current.padding
|
||||
Layout.leftMargin: Style.current.padding
|
||||
Layout.fillWidth: true
|
||||
text: ""
|
||||
customHeight: 200
|
||||
textField.readOnly: true
|
||||
|
@ -116,6 +119,9 @@ Item {
|
|||
// TODO: replace with StatusTextArea once it lives in StatusQ.
|
||||
StyledTextArea {
|
||||
id: logsTxt
|
||||
Layout.rightMargin: Style.current.padding
|
||||
Layout.leftMargin: Style.current.padding
|
||||
Layout.fillWidth: true
|
||||
text: ""
|
||||
customHeight: 200
|
||||
textField.readOnly: true
|
||||
|
|
|
@ -7,16 +7,16 @@ QtObject {
|
|||
property var advancedModule
|
||||
|
||||
// Advanced Module Properties
|
||||
property string currentNetworkName: advancedModule.currentNetworkName
|
||||
property string currentNetworkId: advancedModule.currentNetworkId
|
||||
property string fleet: advancedModule.fleet
|
||||
property string bloomLevel: advancedModule.bloomLevel
|
||||
property bool wakuV2LightClientEnabled: advancedModule.wakuV2LightClientEnabled
|
||||
property bool isTelemetryEnabled: advancedModule.isTelemetryEnabled
|
||||
property bool isAutoMessageEnabled: advancedModule.isAutoMessageEnabled
|
||||
property bool isDebugEnabled: advancedModule.isDebugEnabled
|
||||
property string currentNetworkName: advancedModule? advancedModule.currentNetworkName : ""
|
||||
property string currentNetworkId: advancedModule? advancedModule.currentNetworkId : ""
|
||||
property string fleet: advancedModule? advancedModule.fleet : ""
|
||||
property string bloomLevel: advancedModule? advancedModule.bloomLevel : ""
|
||||
property bool wakuV2LightClientEnabled: advancedModule? advancedModule.wakuV2LightClientEnabled : false
|
||||
property bool isTelemetryEnabled: advancedModule? advancedModule.isTelemetryEnabled : false
|
||||
property bool isAutoMessageEnabled: advancedModule? advancedModule.isAutoMessageEnabled : false
|
||||
property bool isDebugEnabled: advancedModule? advancedModule.isDebugEnabled : false
|
||||
|
||||
property var customNetworksModel: advancedModule.customNetworksModel
|
||||
property var customNetworksModel: advancedModule? advancedModule.customNetworksModel : []
|
||||
|
||||
property bool isWakuV2: root.fleet === Constants.waku_prod ||
|
||||
root.fleet === Constants.waku_test
|
||||
|
@ -33,42 +33,72 @@ QtObject {
|
|||
}
|
||||
|
||||
function logDir() {
|
||||
if(!root.advancedModule)
|
||||
return ""
|
||||
|
||||
return root.advancedModule.logDir()
|
||||
}
|
||||
|
||||
function setNetworkName(networkName) {
|
||||
if(!root.advancedModule)
|
||||
return
|
||||
|
||||
root.advancedModule.setNetworkName(networkName)
|
||||
}
|
||||
|
||||
function setFleet(fleetName) {
|
||||
if(!root.advancedModule)
|
||||
return
|
||||
|
||||
root.advancedModule.setFleet(fleetName)
|
||||
}
|
||||
|
||||
function setBloomLevel(mode) {
|
||||
if(!root.advancedModule)
|
||||
return
|
||||
|
||||
root.advancedModule.setBloomLevel(mode)
|
||||
}
|
||||
|
||||
function setWakuV2LightClientEnabled(mode) {
|
||||
if(!root.advancedModule)
|
||||
return
|
||||
|
||||
root.advancedModule.setWakuV2LightClientEnabled(mode)
|
||||
}
|
||||
|
||||
function toggleTelemetry() {
|
||||
if(!root.advancedModule)
|
||||
return
|
||||
|
||||
root.advancedModule.toggleTelemetry()
|
||||
}
|
||||
|
||||
function toggleAutoMessage() {
|
||||
if(!root.advancedModule)
|
||||
return
|
||||
|
||||
root.advancedModule.toggleAutoMessage()
|
||||
}
|
||||
|
||||
function toggleDebug() {
|
||||
if(!root.advancedModule)
|
||||
return
|
||||
|
||||
root.advancedModule.toggleDebug()
|
||||
}
|
||||
|
||||
function addCustomNetwork(name, endpoint, networkId, networkType) {
|
||||
if(!root.advancedModule)
|
||||
return
|
||||
|
||||
root.advancedModule.addCustomNetwork(name, endpoint, networkId, networkType)
|
||||
}
|
||||
|
||||
function toggleExperimentalFeature(feature) {
|
||||
if(!root.advancedModule)
|
||||
return
|
||||
|
||||
if (feature === experimentalFeatures.wallet) {
|
||||
advancedModule.toggleWalletSection()
|
||||
}
|
||||
|
|
|
@ -43,11 +43,14 @@ Item {
|
|||
anchors.leftMargin: 24
|
||||
from: 0.0
|
||||
to: 1.0
|
||||
value: localAccountSensitiveSettings.volume
|
||||
stepSize: 0.1
|
||||
onValueChanged: {
|
||||
localAccountSensitiveSettings.volume = volume.value
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
value = localAccountSensitiveSettings.volume
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ Item {
|
|||
locale: RootStore.locale
|
||||
currency: RootStore.currentCurrency
|
||||
currentAccount: RootStore.currentAccount
|
||||
changeSelectedAccount: changeSelectedAccount
|
||||
changeSelectedAccount: walletContainer.changeSelectedAccount
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
|
|
|
@ -36,7 +36,7 @@ Item {
|
|||
StyledText {
|
||||
id: title
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: walletHeader.currentAccount.name
|
||||
text: walletHeader.currentAccount? walletHeader.currentAccount.name : ""
|
||||
font.weight: Font.Medium
|
||||
font.pixelSize: 28
|
||||
}
|
||||
|
@ -54,7 +54,7 @@ Item {
|
|||
StyledText {
|
||||
id: walletBalance
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
text: walletHeader.currentAccount.balance.toUpperCase()
|
||||
text: walletHeader.currentAccount? walletHeader.currentAccount.balance.toUpperCase() : ""
|
||||
font.pixelSize: 22
|
||||
}
|
||||
}
|
||||
|
@ -72,7 +72,7 @@ Item {
|
|||
anchors.top: accountRow.bottom
|
||||
anchors.left: accountRow.left
|
||||
addressWidth: 180
|
||||
address: walletHeader.currentAccount.address
|
||||
address: walletHeader.currentAccount? walletHeader.currentAccount.address : ""
|
||||
}
|
||||
|
||||
NetworkSelectPanel {
|
||||
|
|
|
@ -16,6 +16,7 @@ import "./AppLayouts/Chat/popups"
|
|||
import "./AppLayouts/Chat/popups/community"
|
||||
import "./AppLayouts/Profile/popups"
|
||||
import "./AppLayouts/stores"
|
||||
import "./AppLayouts/Browser/stores" as BrowserStores
|
||||
|
||||
import Qt.labs.platform 1.1
|
||||
import Qt.labs.settings 1.0
|
||||
|
@ -150,13 +151,19 @@ Item {
|
|||
Audio {
|
||||
id: sendMessageSound
|
||||
store: rootStore
|
||||
track: "send_message.wav"
|
||||
track: Qt.resolvedUrl("../imports/assets/audio/send_message.wav")
|
||||
}
|
||||
|
||||
Audio {
|
||||
id: notificationSound
|
||||
store: rootStore
|
||||
track: "notification.wav"
|
||||
track: Qt.resolvedUrl("../imports/assets/audio/notification.wav")
|
||||
}
|
||||
|
||||
Audio {
|
||||
id: errorSound
|
||||
track: Qt.resolvedUrl("../imports/assets/audio/error.mp3")
|
||||
store: rootStore
|
||||
}
|
||||
|
||||
AppSearch{
|
||||
|
@ -470,7 +477,7 @@ Item {
|
|||
// property var _walletModel: walletModel
|
||||
// Not Refactored Yet
|
||||
// property var _utilsModel: utilsModel
|
||||
property var _web3Provider: web3Provider
|
||||
property var _web3Provider: BrowserStores.Web3ProviderStore.web3ProviderInst
|
||||
}
|
||||
|
||||
ProfileLayout {
|
||||
|
@ -831,5 +838,6 @@ Item {
|
|||
// console.error('Could not parse the whitelist for sites', e)
|
||||
// }
|
||||
Global.settingsHasLoaded();
|
||||
Global.errorSound = errorSound;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,8 +24,6 @@ Item {
|
|||
|
||||
id: inputBox
|
||||
height: inputRectangle.height + (hasLabel ? inputLabel.height + labelMargin : 0) + (!!validationError ? validationErrorText.height : 0)
|
||||
anchors.right: parent.right
|
||||
anchors.left: parent.left
|
||||
|
||||
StyledText {
|
||||
id: inputLabel
|
||||
|
|
|
@ -853,7 +853,8 @@ Rectangle {
|
|||
anchors.rightMargin: 2
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 2
|
||||
stickerData: sticker
|
||||
// Not Refactored Yet
|
||||
// stickerData: sticker
|
||||
onCloseButtonClicked: {
|
||||
isReply = false
|
||||
}
|
||||
|
@ -941,7 +942,7 @@ Rectangle {
|
|||
icon.name: "bold"
|
||||
//% "Bold"
|
||||
text: qsTrId("bold")
|
||||
selectedTextWithFormationChars: RootStore.selectedTextWithFormationChars
|
||||
selectedTextWithFormationChars: RootStore.getSelectedTextWithFormationChars(messageInputField)
|
||||
onActionTriggered: checked ?
|
||||
unwrapSelection(wrapper, RootStore.getSelectedTextWithFormationChars(messageInputField)) :
|
||||
wrapSelection(wrapper)
|
||||
|
@ -951,7 +952,7 @@ Rectangle {
|
|||
icon.name: "italic"
|
||||
//% "Italic"
|
||||
text: qsTrId("italic")
|
||||
selectedTextWithFormationChars: RootStore.selectedTextWithFormationChars
|
||||
selectedTextWithFormationChars: RootStore.getSelectedTextWithFormationChars(messageInputField)
|
||||
checked: (surroundedBy("*") && !surroundedBy("**")) || surroundedBy("***")
|
||||
onActionTriggered: checked ?
|
||||
unwrapSelection(wrapper, RootStore.getSelectedTextWithFormationChars(messageInputField)) :
|
||||
|
@ -962,7 +963,7 @@ Rectangle {
|
|||
icon.name: "strikethrough"
|
||||
//% "Strikethrough"
|
||||
text: qsTrId("strikethrough")
|
||||
selectedTextWithFormationChars: RootStore.selectedTextWithFormationChars
|
||||
selectedTextWithFormationChars: RootStore.getSelectedTextWithFormationChars(messageInputField)
|
||||
onActionTriggered: checked ?
|
||||
unwrapSelection(wrapper, RootStore.getSelectedTextWithFormationChars(messageInputField)) :
|
||||
wrapSelection(wrapper)
|
||||
|
@ -972,7 +973,7 @@ Rectangle {
|
|||
icon.name: "code"
|
||||
//% "Code"
|
||||
text: qsTrId("code")
|
||||
selectedTextWithFormationChars: RootStore.selectedTextWithFormationChars
|
||||
selectedTextWithFormationChars: RootStore.getSelectedTextWithFormationChars(messageInputField)
|
||||
onActionTriggered: checked ?
|
||||
unwrapSelection(wrapper, RootStore.getSelectedTextWithFormationChars(messageInputField)) :
|
||||
wrapSelection(wrapper)
|
||||
|
|
|
@ -9,7 +9,13 @@ import shared 1.0
|
|||
StatusInputListPopup {
|
||||
id: emojiSuggestions
|
||||
property string shortname
|
||||
property string unicode: emojiSuggestions.modelList[listView.currentIndex].unicode_alternates || emojiSuggestions.modelList[listView.currentIndex].unicode
|
||||
property string unicode: {
|
||||
if(listView.currentIndex < 0 || listView.currentIndex >= emojiSuggestions.modelList.count)
|
||||
return ""
|
||||
|
||||
return emojiSuggestions.modelList[listView.currentIndex].unicode_alternates ||
|
||||
emojiSuggestions.modelList[listView.currentIndex].unicode
|
||||
}
|
||||
|
||||
getImageSource: function (modelData) {
|
||||
return `../../assets/twemoji/72x72/${modelData.unicode}.png`
|
||||
|
|
|
@ -4,12 +4,12 @@ import QtQuick 2.12
|
|||
|
||||
QtObject {
|
||||
id: root
|
||||
property var utilsModelInst: !!utilsModel ? utilsModel : null
|
||||
property var chatsModelInst: !!chatsModel ?chatsModel : null
|
||||
property var userProfileInst: !!userProfile ? userProfile : null
|
||||
property var walletModelInst: !!walletModel ? walletModel : null
|
||||
property var keycardModelInst: !!keycardModel ? keycardModel : null
|
||||
property var profileModelInst: !!profileModel ? profileModel : null
|
||||
// property var utilsModelInst: !!utilsModel ? utilsModel : null
|
||||
// property var chatsModelInst: !!chatsModel ?chatsModel : null
|
||||
// property var userProfileInst: !!userProfile ? userProfile : null
|
||||
// property var walletModelInst: !!walletModel ? walletModel : null
|
||||
// property var keycardModelInst: !!keycardModel ? keycardModel : null
|
||||
// property var profileModelInst: !!profileModel ? profileModel : null
|
||||
property var walletSectionInst: !!walletSection ? walletSection : null
|
||||
property var appSettings: !!localAppSettings ? localAppSettings : null
|
||||
property var accountSensitiveSettings: !!localAccountSensitiveSettings ? localAccountSensitiveSettings : null
|
||||
|
@ -22,13 +22,13 @@ QtObject {
|
|||
property bool displayChatImages: !!accountSensitiveSettings ? accountSensitiveSettings.displayChatImages : false
|
||||
|
||||
property string locale: !!appSettings ? appSettings.locale : ""
|
||||
property string signingPhrase: !!walletModelInst ? walletModelInst.utilsView.signingPhrase : ""
|
||||
property string gasPrice: !!walletModelInst ? walletModelInst.gasView.gasPrice : "0"
|
||||
property string gasEthValue: !!walletModelInst ? walletModelInst.gasView.getGasEthValue : "0"
|
||||
property string currentCurrency: !!walletSectionInst ? walletSectionInst.currentCurrency : ""
|
||||
property string defaultCurrency: !!walletModelInst ? walletModelInst.balanceView.defaultCurrency : "0"
|
||||
property string fiatValue: !!walletModelInst ? walletModelInst.balanceView.getFiatValue : "0"
|
||||
property string cryptoValue: !!walletModelInst ? walletModelInst.balanceView.getCryptoValue : "0"
|
||||
// property string signingPhrase: !!walletModelInst ? walletModelInst.utilsView.signingPhrase : ""
|
||||
// property string gasPrice: !!walletModelInst ? walletModelInst.gasView.gasPrice : "0"
|
||||
// property string gasEthValue: !!walletModelInst ? walletModelInst.gasView.getGasEthValue : "0"
|
||||
// property string currentCurrency: !!walletSectionInst ? walletSectionInst.currentCurrency : ""
|
||||
// property string defaultCurrency: !!walletModelInst ? walletModelInst.balanceView.defaultCurrency : "0"
|
||||
// property string fiatValue: !!walletModelInst ? walletModelInst.balanceView.getFiatValue : "0"
|
||||
// property string cryptoValue: !!walletModelInst ? walletModelInst.balanceView.getCryptoValue : "0"
|
||||
readonly property var formationChars: (["*", "`", "~"])
|
||||
function getSelectedTextWithFormationChars(messageInputField) {
|
||||
let i = 1
|
||||
|
@ -62,14 +62,14 @@ QtObject {
|
|||
}
|
||||
|
||||
function transferEth(from, to, amount, gasLimit, gasPrice, tipLimit, overallLimit, password, uuid) {
|
||||
return walletModelInst.transactionsView.transferEth(from, to, amount, gasLimit, gasPrice, tipLimit, overallLimit, password, uuid);
|
||||
// return walletModelInst.transactionsView.transferEth(from, to, amount, gasLimit, gasPrice, tipLimit, overallLimit, password, uuid);
|
||||
}
|
||||
|
||||
function transferTokens(from, to, address, amount, gasLimit, gasPrice, tipLimit, overallLimit, password, uuid) {
|
||||
return walletModelInst.transactionsView.transferTokens(from, to, address, amount, gasLimit, gasPrice, tipLimit, overallLimit, password, uuid);
|
||||
// return walletModelInst.transactionsView.transferTokens(from, to, address, amount, gasLimit, gasPrice, tipLimit, overallLimit, password, uuid);
|
||||
}
|
||||
|
||||
function copyToClipboard(textToCopy) {
|
||||
chatsModelInst.copyToClipboard(textToCopy)
|
||||
// chatsModelInst.copyToClipboard(textToCopy)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,12 +9,9 @@ QtObject {
|
|||
property var applicationWindow
|
||||
property bool popupOpened: false
|
||||
property int currentMenuTab: 0
|
||||
property var errorSound: Audio {
|
||||
id: errorSound
|
||||
track: Qt.resolvedUrl("../assets/audio/error.mp3")
|
||||
}
|
||||
property var errorSound
|
||||
|
||||
property var mainModuleInst: !!mainModule ? mainModule : null
|
||||
property var mainModuleInst
|
||||
property var toastMessage
|
||||
property bool profilePopupOpened: false
|
||||
//Not refactored yet
|
||||
|
@ -43,6 +40,9 @@ QtObject {
|
|||
}
|
||||
|
||||
function changeAppSectionBySectionType(sectionType, profileSectionId = -1) {
|
||||
if(!root.mainModuleInst)
|
||||
return
|
||||
|
||||
mainModuleInst.setActiveSectionBySectionType(sectionType)
|
||||
if (profileSectionId > -1) {
|
||||
currentMenuTab = profileSectionId;
|
||||
|
@ -76,7 +76,8 @@ QtObject {
|
|||
}
|
||||
|
||||
function playErrorSound() {
|
||||
errorSound.play();
|
||||
if(errorSound)
|
||||
errorSound.play();
|
||||
}
|
||||
|
||||
function settingsHasLoaded() {
|
||||
|
|
33
ui/main.qml
33
ui/main.qml
|
@ -95,20 +95,25 @@ StatusWindow {
|
|||
Connections {
|
||||
target: startupModule
|
||||
onAppStateChanged: {
|
||||
mainModule.openStoreToKeychainPopup.connect(function(){
|
||||
storeToKeychainConfirmationPopup.open()
|
||||
})
|
||||
if(localAccountSensitiveSettings.recentEmojis === "") {
|
||||
localAccountSensitiveSettings.recentEmojis = [];
|
||||
}
|
||||
if (localAccountSensitiveSettings.whitelistedUnfurlingSites === "") {
|
||||
localAccountSensitiveSettings.whitelistedUnfurlingSites = {};
|
||||
}
|
||||
if (localAccountSensitiveSettings.hiddenCommunityWelcomeBanners === "") {
|
||||
localAccountSensitiveSettings.hiddenCommunityWelcomeBanners = [];
|
||||
}
|
||||
if (localAccountSensitiveSettings.hiddenCommunityBackUpBanners === "") {
|
||||
localAccountSensitiveSettings.hiddenCommunityBackUpBanners = [];
|
||||
if(state === Constants.appState.main) {
|
||||
// We set main module to the Global singleton once user is logged in and we move to the main app.
|
||||
Global.mainModuleInst = mainModule
|
||||
|
||||
mainModule.openStoreToKeychainPopup.connect(function(){
|
||||
storeToKeychainConfirmationPopup.open()
|
||||
})
|
||||
if(localAccountSensitiveSettings.recentEmojis === "") {
|
||||
localAccountSensitiveSettings.recentEmojis = [];
|
||||
}
|
||||
if (localAccountSensitiveSettings.whitelistedUnfurlingSites === "") {
|
||||
localAccountSensitiveSettings.whitelistedUnfurlingSites = {};
|
||||
}
|
||||
if (localAccountSensitiveSettings.hiddenCommunityWelcomeBanners === "") {
|
||||
localAccountSensitiveSettings.hiddenCommunityWelcomeBanners = [];
|
||||
}
|
||||
if (localAccountSensitiveSettings.hiddenCommunityBackUpBanners === "") {
|
||||
localAccountSensitiveSettings.hiddenCommunityBackUpBanners = [];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue