auto-save 2026-05-26 00:19 (~5)

This commit is contained in:
2026-05-26 00:19:06 +08:00
parent 544087cf9d
commit 4104bbe5d5
5 changed files with 22 additions and 17 deletions

View File

@@ -170,8 +170,7 @@ export const loadRemoteProjects = async () => {
const response = await requestJson('/canvas-projects')
remoteAvailable = true
const remoteItems = (response.items || []).map(projectFromApi)
const missingLocal = localItems.filter(local => !remoteItems.some(remote => remote.id === local.id))
const importedItems = await importLocalProjectsToServer(missingLocal)
const importedItems = await importLocalProjectsToServer(localItems)
const merged = mergeProjectLists(localItems, [...remoteItems, ...importedItems])
projects.value = merged
saveProjects({ remote: false })

View File

@@ -833,12 +833,12 @@ watch(
)
// Initialize | 初始化
onMounted(() => {
onMounted(async () => {
checkMobile()
window.addEventListener('resize', checkMobile)
// Initialize projects store | 初始化项目存储
initProjectsStore()
await initProjectsStore()
// Load project data | 加载项目数据
loadProjectById(route.params.id)