FIX: Composer preview not caching inline onebox.

This commit is contained in:
Guo Xiang Tan
2019-06-11 09:13:39 +08:00
parent 9168ffc201
commit bd538f7437
7 changed files with 48 additions and 17 deletions

View File

@@ -1,10 +1,10 @@
import { lookupCache } from "pretty-text/oneboxer";
import { cachedInlineOnebox } from "pretty-text/inline-oneboxer";
import {
cachedInlineOnebox,
INLINE_ONEBOX_LOADING_CSS_CLASS,
INLINE_ONEBOX_CSS_CLASS
} from "pretty-text/inline-oneboxer";
} from "pretty-text/context/inline-onebox-css-classes";
const ONEBOX = 1;
const INLINE = 2;
@@ -105,7 +105,7 @@ function applyOnebox(state, silent) {
if (onebox && onebox.title) {
text.content = onebox.title;
attrs.push(["class", INLINE_ONEBOX_CSS_CLASS]);
} else {
} else if (!onebox) {
attrs.push(["class", INLINE_ONEBOX_LOADING_CSS_CLASS]);
}
}