mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 21:50:48 +08:00
DEV: ensures chat can work without discourse-presence
discourse presence can be disabled, given it's a plugin the `composerPresenceManager` service couldn't be present anymore and would cause an error. No test as it's testing imbrication of multiple plugins and hard to test reliably.
This commit is contained in:

committed by
Michael Brown

parent
fb162ad64d
commit
fff1ae60f1
@ -30,6 +30,7 @@ import userAutocomplete from "discourse/lib/autocomplete/user";
|
||||
import { setupHashtagAutocomplete } from "discourse/lib/hashtag-autocomplete";
|
||||
import loadEmojiSearchAliases from "discourse/lib/load-emoji-search-aliases";
|
||||
import { cloneJSON } from "discourse/lib/object";
|
||||
import optionalService from "discourse/lib/optional-service";
|
||||
import { emojiUrlFor } from "discourse/lib/text";
|
||||
import userSearch from "discourse/lib/user-search";
|
||||
import {
|
||||
@ -57,7 +58,6 @@ export default class ChatComposer extends Component {
|
||||
@service siteSettings;
|
||||
@service store;
|
||||
@service chat;
|
||||
@service composerPresenceManager;
|
||||
@service chatComposerWarningsTracker;
|
||||
@service appEvents;
|
||||
@service emojiStore;
|
||||
@ -67,6 +67,8 @@ export default class ChatComposer extends Component {
|
||||
@service modal;
|
||||
@service menu;
|
||||
|
||||
@optionalService composerPresenceManager;
|
||||
|
||||
@tracked isFocused = false;
|
||||
@tracked inProgressUploadsCount = 0;
|
||||
@tracked presenceChannelName;
|
||||
@ -312,7 +314,7 @@ export default class ChatComposer extends Component {
|
||||
return;
|
||||
}
|
||||
|
||||
this.composerPresenceManager.notifyState(
|
||||
this.composerPresenceManager?.notifyState(
|
||||
this.presenceChannelName,
|
||||
!this.draft.editing && this.hasContent,
|
||||
CHAT_PRESENCE_KEEP_ALIVE
|
||||
|
Reference in New Issue
Block a user