diff --git a/resources/assets/js/functions/web.js b/resources/assets/js/functions/web.js index e2fcfd38f..016de3e44 100755 --- a/resources/assets/js/functions/web.js +++ b/resources/assets/js/functions/web.js @@ -615,6 +615,7 @@ import {convertLocalResourcePath} from "../components/Replace/utils"; * @returns {string} */ filterInvalidLine(content) { + if (!content) return ''; return `${content}` .replace(/^(
\s*<\/p>)+|(
\s*<\/p>)+$/gi, '') .replace(/^(
<\/p>)+|(
<\/p>)+$/gi, '')
diff --git a/resources/assets/js/pages/manage/components/DialogWrapper.vue b/resources/assets/js/pages/manage/components/DialogWrapper.vue
index b62cc8fd5..e8e28cbab 100644
--- a/resources/assets/js/pages/manage/components/DialogWrapper.vue
+++ b/resources/assets/js/pages/manage/components/DialogWrapper.vue
@@ -3056,7 +3056,7 @@ export default {
},
onVisible(v) {
- this.startMsgId = $A.runNum(v.length > 0 ? v[0] : 0)
+ this.startMsgId = $A.runNum(v.length ? v[Math.min(1, v.length - 1)] : 0)
},
onBack() {
diff --git a/resources/assets/js/store/actions.js b/resources/assets/js/store/actions.js
index 63652ae97..c53722b5f 100644
--- a/resources/assets/js/store/actions.js
+++ b/resources/assets/js/store/actions.js
@@ -990,29 +990,29 @@ export default {
...dataMap.json.map(key => $A.IDBJson(key))
]);
- // 更新state
+ // 更新 state
[...dataMap.string, ...dataMap.array, ...dataMap.json].forEach((key, index) => {
state[key] = data[index];
});
- // 特殊处理cacheDialogs
+ // 特殊处理 cacheDialogs
state.cacheDialogs = state.cacheDialogs.map(item => ({
...item,
loading: false,
}));
- // 特殊处理dialogDrafts
+ // 特殊处理 dialogDrafts
state.dialogDrafts = state.dialogDrafts.filter(item => !!item.content).map(item => ({
...item,
tag: !!item.content,
}));
- // TranslationLanguage检查
+ // TranslationLanguage 检查
if (typeof languageList[state.cacheTranslationLanguage] === "undefined") {
state.cacheTranslationLanguage = languageName;
}
- // TranscriptionLanguage检查
+ // TranscriptionLanguage 检查
if (typeof languageList[state.cacheTranscriptionLanguage] === "undefined") {
state.cacheTranscriptionLanguage = '';
}
@@ -1024,7 +1024,7 @@ export default {
state.userIsAdmin = $A.inArray("admin", state.userInfo.identity);
}
- // 处理ServerUrl
+ // 处理 ServerUrl
if (state.cacheServerUrl) {
window.systemInfo.apiUrl = state.cacheServerUrl
}