@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
  }]);
@@ -17,7 +17,7 @@ var wrapperClass = css({
17
17
  left: 0,
18
18
  right: 0,
19
19
  position: 'fixed',
20
- zIndex: 30
20
+ zIndex: 120
21
21
  });
22
22
  var hasCustomId = function hasCustomId(settings) {
23
23
  return Object.hasOwnProperty.call(settings, 'id');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/sdoc-editor",
3
- "version": "0.1.109",
3
+ "version": "0.1.110",
4
4
  "private": false,
5
5
  "description": "This is a sdoc editor",
6
6
  "main": "dist/index.js",
@@ -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
  }
@@ -341,5 +341,6 @@
341
341
  "Reduce_font_size": "减小字号",
342
342
  "Font": "字体",
343
343
  "All_fonts": "所有字体",
344
- "Default_font": "默认字体"
344
+ "Default_font": "默认字体",
345
+ "Document_content_load_failed": "文档内容加载失败, 请刷新页面重新访问"
345
346
  }