mirror of
https://github.com/flarum/framework.git
synced 2025-03-15 00:05:12 +08:00
Fix race condition in post preview
The post composer could have been closed in between scheduling and executing the callback. Fixes flarum/org#58. Refs #1881.
This commit is contained in:
parent
ac14f84a9a
commit
2f3d9995d1
@ -52,6 +52,10 @@ export default class ReplyPlaceholder extends Component {
|
||||
// body with a preview.
|
||||
let preview;
|
||||
const updateInterval = setInterval(() => {
|
||||
// Since we're polling, the composer may have been closed in the meantime,
|
||||
// so we bail in that case.
|
||||
if (!app.composer.component) return;
|
||||
|
||||
const content = app.composer.component.content();
|
||||
|
||||
if (preview === content) return;
|
||||
|
Loading…
x
Reference in New Issue
Block a user