FIX: correctly account for direct replies with presence
followup to 301a0fa5
, we were not checking the action so we
were publishing some messages from composers we did not intend to
This commit is contained in:
parent
301a0fa54e
commit
2045f51312
|
@ -6,6 +6,7 @@ import discourseComputed, {
|
||||||
on
|
on
|
||||||
} from "discourse-common/utils/decorators";
|
} from "discourse-common/utils/decorators";
|
||||||
import { REPLYING, CLOSED, EDITING } from "../lib/presence-manager";
|
import { REPLYING, CLOSED, EDITING } from "../lib/presence-manager";
|
||||||
|
import { REPLY, EDIT } from "discourse/models/composer";
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
// Passed in variables
|
// Passed in variables
|
||||||
|
@ -44,12 +45,18 @@ export default Component.extend({
|
||||||
@observes("reply", "title")
|
@observes("reply", "title")
|
||||||
typing() {
|
typing() {
|
||||||
if (this.presenceManager) {
|
if (this.presenceManager) {
|
||||||
|
let action = this.action;
|
||||||
|
|
||||||
|
if (action !== REPLY && action !== EDIT) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const postId = this.get("post.id");
|
const postId = this.get("post.id");
|
||||||
|
|
||||||
this._throttle = this.presenceManager.throttlePublish(
|
this._throttle = this.presenceManager.throttlePublish(
|
||||||
postId ? EDITING : REPLYING,
|
action === EDIT ? EDITING : REPLYING,
|
||||||
this.whisper,
|
this.whisper,
|
||||||
postId
|
action === EDIT ? postId : undefined
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue