优化保存恢复功能

This commit is contained in:
锦恢 2024-10-18 20:40:12 +08:00
parent 08148209e7
commit d901594c16
4 changed files with 16 additions and 5 deletions

Binary file not shown.

View File

@ -12,10 +12,10 @@ export let saveDelay = 1000;
/**
*
* @param {string} file
* @param {*} payload
* @param {any} payload
*/
export async function saveView(file, payload) {
if (payload.waves === undefined || payload.waves.length === 0) {
if (payload === undefined) {
return;
}
if (mode === 'debug') {

View File

@ -6,6 +6,7 @@ import { BSON } from "bson";
import { Id2Pivot, orderedTimes, UserPivots } from "@/components/pivot/pivot-view";
import { TreeviewExpandSignals } from "@/components/treeview/modules";
import { controlPanel } from "@/components/right-nav";
import { saveViewApi } from "@/api";
export const recoverConfig = {
/**
@ -228,6 +229,16 @@ export function recoverSession(topModules) {
recoverConfig.treeviewExpands = null;
recoverConfig.waves = null;
recoverConfig.rightNavIndex = null;
// 更新后端缓存
saveViewApi({
waves: true,
views: true,
state: true,
pivots: true,
treeviewExpands: true,
rightNavIndex: true
});
}
/**