mirror of
https://github.com/flarum/core.git
synced 2025-08-06 00:17:31 +02:00
Stop rendering previews when composer is hidden
This brings this component in line with the `ReplyPlaceholder` one.
This commit is contained in:
@@ -24,6 +24,10 @@ export default class ComposerPostPreview extends Component {
|
|||||||
// body with a preview.
|
// body with a preview.
|
||||||
let preview;
|
let preview;
|
||||||
const updatePreview = () => {
|
const updatePreview = () => {
|
||||||
|
// Since we're polling, the composer may have been closed in the meantime,
|
||||||
|
// so we bail in that case.
|
||||||
|
if (!this.attrs.composer.isVisible()) return;
|
||||||
|
|
||||||
const content = this.attrs.composer.fields.content();
|
const content = this.attrs.composer.fields.content();
|
||||||
|
|
||||||
if (preview === content) return;
|
if (preview === content) return;
|
||||||
|
Reference in New Issue
Block a user