@seafile/sdoc-editor 3.0.167 → 3.0.169

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.
@@ -41,11 +41,17 @@ var useNotificationsMount = exports.useNotificationsMount = function useNotifica
41
41
  }, [collaborators, t]);
42
42
  var request = (0, _react.useCallback)(/*#__PURE__*/function () {
43
43
  var _ref = (0, _asyncToGenerator2["default"])(/*#__PURE__*/(0, _regenerator2["default"])().m(function _callee(notification) {
44
- var eventBus, res, notifications, _t;
44
+ var to_users, currentUserInfo, eventBus, res, notifications, _t;
45
45
  return (0, _regenerator2["default"])().w(function (_context) {
46
46
  while (1) switch (_context.p = _context.n) {
47
47
  case 0:
48
- popupBrowserCommentNotification(notification);
48
+ if (notification) {
49
+ to_users = notification.to_users;
50
+ currentUserInfo = _context2["default"].getUserInfo();
51
+ if (Array.isArray(to_users) && to_users.length > 0 && to_users.includes(currentUserInfo.username)) {
52
+ popupBrowserCommentNotification(notification);
53
+ }
54
+ }
49
55
  eventBus = _eventBus["default"].getInstance();
50
56
  dispatch({
51
57
  type: _constants2.DOC_NOTIFICATION_REDUCER_TYPE.FETCHING
@@ -8,7 +8,6 @@ Object.defineProperty(exports, "__esModule", {
8
8
  exports["default"] = void 0;
9
9
  var _react = _interopRequireWildcard(require("react"));
10
10
  var _constants = require("../../../../constants");
11
- var _context = _interopRequireDefault(require("../../../../context"));
12
11
  var _dropdownMenuItem = _interopRequireDefault(require("../../../commons/dropdown-menu-item"));
13
12
  var _constants2 = require("../../../constants");
14
13
  var _helpers = require("../helpers");
@@ -19,7 +18,6 @@ var FileLinkMenu = function FileLinkMenu(_ref) {
19
18
  eventBus = _ref.eventBus;
20
19
  var disabled = (0, _helpers.isMenuDisabled)(editor, readonly);
21
20
  var menuConfig = _constants2.MENUS_CONFIG_MAP[_constants2.FILE_LINK];
22
- var shouldShow = (editor === null || editor === void 0 ? void 0 : editor.editorType) === _constants.WIKI_EDITOR && _context["default"].hasLinkedRepos();
23
21
  var openSelectFileDialog = (0, _react.useCallback)(function () {
24
22
  eventBus.dispatch(_constants.INTERNAL_EVENT.INSERT_ELEMENT, {
25
23
  type: _constants2.ELEMENT_TYPE.FILE_LINK,
@@ -29,7 +27,6 @@ var FileLinkMenu = function FileLinkMenu(_ref) {
29
27
 
30
28
  // eslint-disable-next-line react-hooks/exhaustive-deps
31
29
  }, [toggle, eventBus]);
32
- if (!shouldShow) return null;
33
30
  return /*#__PURE__*/_react["default"].createElement(_dropdownMenuItem["default"], {
34
31
  disabled: disabled,
35
32
  menuConfig: menuConfig,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/sdoc-editor",
3
- "version": "3.0.167",
3
+ "version": "3.0.169",
4
4
  "main": "dist/index.js",
5
5
  "scripts": {
6
6
  "test": "jest",
@@ -72,5 +72,5 @@
72
72
  "publishConfig": {
73
73
  "access": "public"
74
74
  },
75
- "gitHead": "b96b1362cacc8e105c01f80c09473cbf19e2f827"
75
+ "gitHead": "9933ce94d36de160c8a265b9b917717c74447ddb"
76
76
  }