1
0
mirror of https://github.com/flarum/core.git synced 2025-08-04 23:47:32 +02:00

Stop rendering previews when composer is hidden

This brings this component in line with the `ReplyPlaceholder` one.
This commit is contained in:
Franz Liedke
2020-09-11 17:10:57 +02:00
parent 24935eacaf
commit 47ce93d2fd

View File

@@ -24,6 +24,10 @@ export default class ComposerPostPreview extends Component {
// body with a preview.
let preview;
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();
if (preview === content) return;