no message

This commit is contained in:
kuaifan 2025-03-13 21:35:13 +08:00
parent 38eaf2eb02
commit 3c9447e1b6
3 changed files with 8 additions and 7 deletions

View File

@ -615,6 +615,7 @@ import {convertLocalResourcePath} from "../components/Replace/utils";
* @returns {string} * @returns {string}
*/ */
filterInvalidLine(content) { filterInvalidLine(content) {
if (!content) return '';
return `${content}` return `${content}`
.replace(/^(<p>\s*<\/p>)+|(<p>\s*<\/p>)+$/gi, '') .replace(/^(<p>\s*<\/p>)+|(<p>\s*<\/p>)+$/gi, '')
.replace(/^(<p><br\/*><\/p>)+|(<p><br\/*><\/p>)+$/gi, '') .replace(/^(<p><br\/*><\/p>)+|(<p><br\/*><\/p>)+$/gi, '')

View File

@ -3056,7 +3056,7 @@ export default {
}, },
onVisible(v) { 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() { onBack() {

View File

@ -990,29 +990,29 @@ export default {
...dataMap.json.map(key => $A.IDBJson(key)) ...dataMap.json.map(key => $A.IDBJson(key))
]); ]);
// 更新state // 更新 state
[...dataMap.string, ...dataMap.array, ...dataMap.json].forEach((key, index) => { [...dataMap.string, ...dataMap.array, ...dataMap.json].forEach((key, index) => {
state[key] = data[index]; state[key] = data[index];
}); });
// 特殊处理cacheDialogs // 特殊处理 cacheDialogs
state.cacheDialogs = state.cacheDialogs.map(item => ({ state.cacheDialogs = state.cacheDialogs.map(item => ({
...item, ...item,
loading: false, loading: false,
})); }));
// 特殊处理dialogDrafts // 特殊处理 dialogDrafts
state.dialogDrafts = state.dialogDrafts.filter(item => !!item.content).map(item => ({ state.dialogDrafts = state.dialogDrafts.filter(item => !!item.content).map(item => ({
...item, ...item,
tag: !!item.content, tag: !!item.content,
})); }));
// TranslationLanguage检查 // TranslationLanguage 检查
if (typeof languageList[state.cacheTranslationLanguage] === "undefined") { if (typeof languageList[state.cacheTranslationLanguage] === "undefined") {
state.cacheTranslationLanguage = languageName; state.cacheTranslationLanguage = languageName;
} }
// TranscriptionLanguage检查 // TranscriptionLanguage 检查
if (typeof languageList[state.cacheTranscriptionLanguage] === "undefined") { if (typeof languageList[state.cacheTranscriptionLanguage] === "undefined") {
state.cacheTranscriptionLanguage = ''; state.cacheTranscriptionLanguage = '';
} }
@ -1024,7 +1024,7 @@ export default {
state.userIsAdmin = $A.inArray("admin", state.userInfo.identity); state.userIsAdmin = $A.inArray("admin", state.userInfo.identity);
} }
// 处理ServerUrl // 处理 ServerUrl
if (state.cacheServerUrl) { if (state.cacheServerUrl) {
window.systemInfo.apiUrl = state.cacheServerUrl window.systemInfo.apiUrl = state.cacheServerUrl
} }