mirror of
https://github.com/citizenfx/cfx-server-data.git
synced 2025-01-09 14:52:54 +08:00
Merge pull request #38 from jaymo1011/master
chat: fix help text and params in chat suggestions
This commit is contained in:
commit
f243a02a6f
@ -77,12 +77,17 @@ window.APP = {
|
||||
this.oldMessagesIndex = -1;
|
||||
},
|
||||
ON_SUGGESTION_ADD({ suggestion }) {
|
||||
const duplicateSuggestion = this.backingSuggestions.find(a => a.name == suggestion.name);
|
||||
if (duplicateSuggestion) {
|
||||
if(suggestion.help || suggestion.params) {
|
||||
duplicateSuggestion.help = suggestion.help || "";
|
||||
duplicateSuggestion.params = suggestion.params || [];
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (!suggestion.params) {
|
||||
suggestion.params = []; //TODO Move somewhere else
|
||||
}
|
||||
if (this.backingSuggestions.find(a => a.name == suggestion.name)) {
|
||||
return;
|
||||
}
|
||||
this.backingSuggestions.push(suggestion);
|
||||
},
|
||||
ON_SUGGESTION_REMOVE({ name }) {
|
||||
|
Loading…
Reference in New Issue
Block a user