@seafile/seafile-editor 2.0.46 → 2.0.47-beta

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -31,6 +31,7 @@ var _slateViewer = _interopRequireDefault(require("../editors/slate-viewer"));
31
31
  function MarkdownViewer(_ref) {
32
32
  let {
33
33
  isFetching,
34
+ isTyping,
34
35
  value,
35
36
  mathJaxSource,
36
37
  isShowOutline,
@@ -40,22 +41,26 @@ function MarkdownViewer(_ref) {
40
41
  options
41
42
  } = _ref;
42
43
  const [richValue, setRichValue] = (0, _react.useState)([]);
43
- const [isLoading, setIsLoading] = (0, _react.useState)(true);
44
+ const [isLoading, setIsLoading] = (0, _react.useState)(isTyping ? false : true);
44
45
  const {
45
46
  isLoadingMathJax
46
47
  } = (0, _useMathjax.default)(mathJaxSource);
47
48
  (0, _react.useEffect)(() => {
48
49
  if (!isFetching) {
49
- setIsLoading(true);
50
+ if (!isTyping) {
51
+ setIsLoading(true);
52
+ }
50
53
  const richValue = (0, _slateConvert.mdStringToSlate)(value);
51
54
  beforeRenderCallback && beforeRenderCallback(richValue);
52
55
  setRichValue(richValue);
53
- setTimeout(() => {
54
- setIsLoading(false);
55
- }, 0);
56
+ if (!isTyping) {
57
+ setTimeout(() => {
58
+ setIsLoading(false);
59
+ }, 0);
60
+ }
56
61
  }
57
62
  // eslint-disable-next-line react-hooks/exhaustive-deps
58
- }, [isFetching, value]);
63
+ }, [isFetching, value, isTyping]);
59
64
  const props = {
60
65
  options,
61
66
  isSupportFormula: !!mathJaxSource,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/seafile-editor",
3
- "version": "2.0.46",
3
+ "version": "2.0.47-beta",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {