🐛 Fixed extension management issues

This commit is contained in:
2025-07-01 23:25:24 +08:00
parent 3e45e6aa9b
commit 1ccee779ae
9 changed files with 290 additions and 197 deletions

View File

@@ -150,8 +150,7 @@ const saveEdit = async () => {
const trimmedTitle = editingTitle.value.trim();
const error = validateTitle(trimmedTitle);
if (error) {
console.error('保存失败:', error);
// 保持编辑状态,不清除
return;
}
@@ -159,8 +158,6 @@ const saveEdit = async () => {
await documentStore.updateDocumentMetadata(editingId.value, trimmedTitle);
await documentStore.updateDocuments();
} catch (error) {
console.error('保存失败:', error);
// 保持编辑状态,不清除
return;
}
}
@@ -186,7 +183,7 @@ const handleDelete = async (doc: Document, event: Event) => {
}
}
} catch (error) {
console.error('删除失败:', error);
console.error('deleted failed:', error);
}
deleteConfirmId.value = null;
} else {

View File

@@ -4,6 +4,7 @@ import {onMounted, onUnmounted, ref, watch} from 'vue';
import {useConfigStore} from '@/stores/configStore';
import {useEditorStore} from '@/stores/editorStore';
import {useUpdateStore} from '@/stores/updateStore';
import {useDocumentStore} from '@/stores/documentStore';
import * as runtime from '@wailsio/runtime';
import {useRouter} from 'vue-router';
import BlockLanguageSelector from './BlockLanguageSelector.vue';
@@ -14,6 +15,7 @@ import {getLanguage} from '@/views/editor/extensions/codeblock/lang-parser/langu
const editorStore = useEditorStore();
const configStore = useConfigStore();
const updateStore = useUpdateStore();
const documentStore = useDocumentStore();
const {t} = useI18n();
const router = useRouter();
@@ -32,7 +34,11 @@ const toggleAlwaysOnTop = async () => {
// 跳转到设置页面
const goToSettings = () => {
router.push('/settings');
const currentDocId = documentStore.currentDocumentId;
router.push({
path: '/settings',
query: { documentId: currentDocId || undefined }
});
};