@seafile/sdoc-editor 2.0.68 → 2.0.69
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.
|
@@ -39,7 +39,7 @@ const RevisionOperations = _ref => {
|
|
|
39
39
|
const [isLoading, setLoading] = (0, _react.useState)(false);
|
|
40
40
|
const {
|
|
41
41
|
loadDocument
|
|
42
|
-
} = (0, _hooks.useDocument)();
|
|
42
|
+
} = (0, _hooks.useDocument)(false);
|
|
43
43
|
(0, _react.useEffect)(() => {
|
|
44
44
|
if (!isSdocRevision) return;
|
|
45
45
|
if (isShowChanges) return;
|
|
@@ -7,7 +7,8 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
exports.useDocument = void 0;
|
|
8
8
|
var _react = require("react");
|
|
9
9
|
var _context = _interopRequireDefault(require("../context"));
|
|
10
|
-
const useDocument = ()
|
|
10
|
+
const useDocument = function () {
|
|
11
|
+
let isInitData = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
|
|
11
12
|
const isSdocRevision = _context.default.getSetting('isSdocRevision');
|
|
12
13
|
const isPublished = _context.default.getSetting('isPublished');
|
|
13
14
|
const [isFirstLoading, setIsFirstLoading] = (0, _react.useState)(true);
|
|
@@ -53,6 +54,7 @@ const useDocument = () => {
|
|
|
53
54
|
}, [loadDocument]);
|
|
54
55
|
(0, _react.useEffect)(() => {
|
|
55
56
|
if (isSdocRevision && isPublished) return;
|
|
57
|
+
if (!isInitData) return;
|
|
56
58
|
loadDocument().then(document => {
|
|
57
59
|
setDocument(document);
|
|
58
60
|
setIsFirstLoading(false);
|