mirror of
https://github.com/discourse/discourse.git
synced 2025-05-28 01:56:58 +08:00
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:
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user