mirror of
https://github.com/discourse/discourse.git
synced 2025-03-05 02:07:56 +08:00
PERF: prevents any fast edit work if you can't edit (#15759)
This commit is contained in:
parent
48cf5e2fbc
commit
c46b55dc3b
@ -192,6 +192,7 @@ export default Component.extend(KeyEnterEscape, {
|
|||||||
this.topic.postStream.findLoadedPost(postId)?.can_edit
|
this.topic.postStream.findLoadedPost(postId)?.can_edit
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (this._canEditPost) {
|
||||||
const regexp = new RegExp(regexSafeStr(quoteState.buffer), "gi");
|
const regexp = new RegExp(regexSafeStr(quoteState.buffer), "gi");
|
||||||
const matches = postBody.match(regexp);
|
const matches = postBody.match(regexp);
|
||||||
|
|
||||||
@ -210,6 +211,7 @@ export default Component.extend(KeyEnterEscape, {
|
|||||||
this.set("_fastEditNewSelection", quoteState.buffer);
|
this.set("_fastEditNewSelection", quoteState.buffer);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// avoid hard loops in quote selection unconditionally
|
// avoid hard loops in quote selection unconditionally
|
||||||
// this can happen if you triple click text in firefox
|
// this can happen if you triple click text in firefox
|
||||||
|
Loading…
x
Reference in New Issue
Block a user