cfx-server-data icon indicating copy to clipboard operation
cfx-server-data copied to clipboard

fix(chat): Make sure user doesn't land on hidden or null chat mode, after using "chat:removeMode"

Open CritteRo opened this issue 4 years ago • 0 comments

PR started from issue: https://forum.cfx.re/t/chat-chat-removemode-event-will-not-remove-the-all-mode-immediately/4790531/2

Changes made:

  • moved globalMode (_global) as the first mode, and defaultMode as second mode and changed default modeIdx value to reflect that. This should fix the situations where users on default mode will have their "all" chat removed, but then could see "_global" chat.

  • Added a check on ON_MODE_REMOVE(), to make sure that modeIdx doesn't point to an undefined mode after removing the chat mode. (But it could still point to hidden modes!! )

CritteRo avatar Dec 23 '21 15:12 CritteRo