REFACTOR: naming and state refactor (#19187)

- better handling of drawer state using chat state manager
- removes various float and topic occurrences to use drawer
- ensures user can chat before doing a lot of chat setup
- fixes a bug which was creating presence errors in tests
- removes dead code
This commit is contained in:
Joffrey JAFFEUX
2022-11-25 14:15:38 +01:00
committed by GitHub
parent cad2fe6089
commit 84c1cc70d6
43 changed files with 401 additions and 391 deletions

View File

@ -4,12 +4,10 @@ import Service from "@ember/service";
let publicChannels;
let userCanChat;
let fullScreenChatOpen;
class ChatStub extends Service {
userCanChat = userCanChat;
publicChannels = publicChannels;
fullScreenChatOpen = fullScreenChatOpen;
}
export function setup(context, options = {}) {
@ -20,13 +18,9 @@ export function setup(context, options = {}) {
? options.publicChannels
: [fabricators.chatChannel()];
userCanChat = isPresent(options.userCanChat) ? options.userCanChat : true;
fullScreenChatOpen = isPresent(options.fullScreenChatOpen)
? options.fullScreenChatOpen
: false;
}
export function teardown() {
publicChannels = [];
userCanChat = true;
fullScreenChatOpen = false;
}