fix: use ChatDocumentHandler.AutoCompletionType enum instead of string to chose delegates
This commit is contained in:
@@ -215,14 +215,12 @@ ToolBar {
|
||||
return;
|
||||
}
|
||||
|
||||
completionMenu.completionType = completionInfo.type
|
||||
if (completionInfo.type === ChatDocumentHandler.User) {
|
||||
completionMenu.completionType = "username"
|
||||
completionMenu.model = currentRoom.getUsers(completionInfo.keyword);
|
||||
} else if (completionInfo.type === ChatDocumentHandler.Command) {
|
||||
completionMenu.completionType = "command"
|
||||
completionMenu.model = CommandModel.filterModel(completionInfo.keyword);
|
||||
} else {
|
||||
completionMenu.completionType = "emoji"
|
||||
completionMenu.model = EmojiModel.filterModel(completionInfo.keyword);
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ Popup {
|
||||
property string currentDisplayText: currentItem && currentItem.displayName ? currentItem.displayName : ""
|
||||
property string currentUserId: currentItem && currentItem.id ? currentItem.id : ""
|
||||
|
||||
property string completionType: ""
|
||||
property int completionType: ChatDocumentHandler.Emoji
|
||||
property int beginPosition: 0
|
||||
property int endPosition: 0
|
||||
|
||||
@@ -50,11 +50,11 @@ Popup {
|
||||
id: completionListView
|
||||
implicitWidth: contentWidth
|
||||
delegate: {
|
||||
if (completionType === "emoji") {
|
||||
if (completionType === ChatDocumentHandler.Emoji) {
|
||||
emojiDelegate
|
||||
} else if (completionType === "command") {
|
||||
} else if (completionType === ChatDocumentHandler.Command) {
|
||||
commandDelegate
|
||||
} else if (completionType === "username") {
|
||||
} else if (completionType === ChatDocumentHandler.User) {
|
||||
usernameDelegate
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user