MCPcopy
hub / github.com/agent0ai/agent-zero / installSession

Function installSession

plugins/_editor/webui/editor-store.js:958–978  ·  view source on GitHub ↗
(session)

Source from the content-addressed store, hash-verified

956 },
957
958 installSession(session) {
959 const existingIndex = this.tabs.findIndex((tab) => (
960 (session.file_id && tab.file_id === session.file_id)
961 || (session.path && tab.path === session.path)
962 ));
963 if (existingIndex >= 0) {
964 const tabId = this.tabs[existingIndex].tab_id;
965 const wasActive = this.activeTabId === tabId || this.session?.tab_id === tabId;
966 const merged = { ...this.tabs[existingIndex], ...session, tab_id: tabId };
967 this.tabs.splice(existingIndex, 1, merged);
968 this.activeTabId = tabId;
969 if (wasActive) {
970 this.hydrateActiveSession(merged, { preservePage: true, focus: false });
971 return;
972 }
973 } else {
974 this.tabs.push(session);
975 this.activeTabId = session.tab_id;
976 }
977 this.selectTab(this.activeTabId);
978 },
979
980 hydrateActiveSession(tab, options = {}) {
981 this.session = tab || null;

Callers

nothing calls this directly

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected