@seafile/sdoc-editor 0.1.109 → 0.1.110
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.
|
@@ -48,6 +48,9 @@ var SocketManager = /*#__PURE__*/_createClass(function SocketManager(editor, doc
|
|
|
48
48
|
// Put the failed operation into the pending list and re-execute it
|
|
49
49
|
_this.pendingOperationList.unshift(operations);
|
|
50
50
|
_this.sendNextOperations();
|
|
51
|
+
} else if (error_type === 'document_content_load_failed') {
|
|
52
|
+
// After a short-term reconnection, the content of the document fails to load
|
|
53
|
+
_this.dispatchConnectState(error_type);
|
|
51
54
|
} else if (error_type === 'operation_exec_error') {
|
|
52
55
|
_this.editor.isRemote = true;
|
|
53
56
|
revertOperationList(_this.editor, [operations]);
|
|
@@ -22,6 +22,14 @@ var TipMessage = /*#__PURE__*/function (_React$Component) {
|
|
|
22
22
|
duration: null
|
|
23
23
|
});
|
|
24
24
|
};
|
|
25
|
+
_this.onDocumentLoadError = function () {
|
|
26
|
+
var t = _this.props.t;
|
|
27
|
+
var message = t('Document_content_load_failed');
|
|
28
|
+
toaster.danger(message, {
|
|
29
|
+
hasCloseButton: true,
|
|
30
|
+
duration: null
|
|
31
|
+
});
|
|
32
|
+
};
|
|
25
33
|
_this.onDisconnect = function () {
|
|
26
34
|
var _this$props = _this.props,
|
|
27
35
|
t = _this$props.t,
|
|
@@ -111,12 +119,14 @@ var TipMessage = /*#__PURE__*/function (_React$Component) {
|
|
|
111
119
|
|
|
112
120
|
// op execute error
|
|
113
121
|
this.unsubscribeOpExecError = eventBus.subscribe('operation_exec_error', this.onOperationExecuteError);
|
|
122
|
+
this.unsubscribeDocumentLoadError = eventBus.subscribe('document_content_load_failed', this.onDocumentLoadError);
|
|
114
123
|
}
|
|
115
124
|
}, {
|
|
116
125
|
key: "componentWillUnmount",
|
|
117
126
|
value: function componentWillUnmount() {
|
|
118
127
|
this.unsubscribeSavingEvent();
|
|
119
128
|
this.unsubscribeSavedEvent();
|
|
129
|
+
this.unsubscribeDocumentLoadError();
|
|
120
130
|
clearTimeout(this.saveTimer);
|
|
121
131
|
}
|
|
122
132
|
}]);
|
package/package.json
CHANGED
|
@@ -339,5 +339,6 @@
|
|
|
339
339
|
"Reduce_font_size": "Reduce font size",
|
|
340
340
|
"Font": "Font",
|
|
341
341
|
"All_fonts": "All fonts",
|
|
342
|
-
"Default_font": "Default font"
|
|
342
|
+
"Default_font": "Default font",
|
|
343
|
+
"Document_content_load_failed": "Document content failed to load, please refresh the page to try again"
|
|
343
344
|
}
|