@seafile/sdoc-editor 1.0.188 → 1.0.189
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.
|
@@ -140,14 +140,14 @@ function AIModule(_ref) {
|
|
|
140
140
|
if (adjustSubMenu && adjustSubMenu.contains(event.target)) return;
|
|
141
141
|
const langSubMenu = document.querySelector('.ai-lang-sub-menu');
|
|
142
142
|
if (langSubMenu && langSubMenu.contains(event.target)) return;
|
|
143
|
-
if (!searchResult) {
|
|
143
|
+
if (!searchResult || opType === _constants.OPERATION_TYPES.TRANSLATE) {
|
|
144
144
|
onCloseClick();
|
|
145
145
|
return;
|
|
146
146
|
}
|
|
147
147
|
if (searchResult) {
|
|
148
148
|
setIsShowTipDialog(true);
|
|
149
149
|
}
|
|
150
|
-
}, [onCloseClick, searchResult]);
|
|
150
|
+
}, [onCloseClick, opType, searchResult]);
|
|
151
151
|
(0, _react.useEffect)(() => {
|
|
152
152
|
toggleAskAI();
|
|
153
153
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
@@ -351,8 +351,8 @@ function AIModule(_ref) {
|
|
|
351
351
|
});
|
|
352
352
|
}, [searchResult, t]);
|
|
353
353
|
const onDeprecationClick = (0, _react.useCallback)(() => {
|
|
354
|
-
|
|
355
|
-
}, []);
|
|
354
|
+
onCloseClick();
|
|
355
|
+
}, [onCloseClick]);
|
|
356
356
|
const isShowAdjust = (0, _react.useMemo)(() => {
|
|
357
357
|
return ![_constants.OPERATION_TYPES.DEFAULT, _constants.OPERATION_TYPES.TRANSLATE].includes(opType);
|
|
358
358
|
}, [opType]);
|