@seafile/seafile-editor 2.0.47-beta5 → 2.0.47

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,7 +31,7 @@ var _slateViewer = _interopRequireDefault(require("../editors/slate-viewer"));
31
31
  function MarkdownViewer(_ref) {
32
32
  let {
33
33
  isFetching,
34
- isShowLoading,
34
+ isShowLoading = true,
35
35
  value,
36
36
  mathJaxSource,
37
37
  isShowOutline,
@@ -41,22 +41,26 @@ function MarkdownViewer(_ref) {
41
41
  options
42
42
  } = _ref;
43
43
  const [richValue, setRichValue] = (0, _react.useState)([]);
44
- const [isLoading, setIsLoading] = (0, _react.useState)(true);
44
+ const [isLoading, setIsLoading] = (0, _react.useState)(Boolean(isShowLoading));
45
45
  const {
46
46
  isLoadingMathJax
47
47
  } = (0, _useMathjax.default)(mathJaxSource);
48
48
  (0, _react.useEffect)(() => {
49
49
  if (!isFetching) {
50
- setIsLoading(true);
50
+ if (isShowLoading) {
51
+ setIsLoading(true);
52
+ }
51
53
  const richValue = (0, _slateConvert.mdStringToSlate)(value);
52
54
  beforeRenderCallback && beforeRenderCallback(richValue);
53
55
  setRichValue(richValue);
54
- setTimeout(() => {
55
- setIsLoading(false);
56
- }, 0);
56
+ if (isShowLoading) {
57
+ setTimeout(() => {
58
+ setIsLoading(false);
59
+ }, 0);
60
+ }
57
61
  }
58
62
  // eslint-disable-next-line react-hooks/exhaustive-deps
59
- }, [isFetching, value]);
63
+ }, [isFetching, value, isShowLoading]);
60
64
  const props = {
61
65
  options,
62
66
  isSupportFormula: !!mathJaxSource,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/seafile-editor",
3
- "version": "2.0.47-beta5",
3
+ "version": "2.0.47",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "scripts": {