MCPcopy Create free account
hub / github.com/MCSManager/MCSManager / onEditTabs

Function onEditTabs

frontend/src/hooks/useFileManager.ts:151–172  ·  view source on GitHub ↗
(targetKey: MouseEvent | Key | KeyboardEvent, action: "remove" | "add")

Source from the content-addressed store, hash-verified

149 };
150
151 const onEditTabs = (targetKey: MouseEvent | Key | KeyboardEvent, action: "remove" | "add") => {
152 if (action === "add") {
153 if (currentTabs.value.length >= 10) {
154 message.warning(t("TXT_CODE_22042570"));
155 return;
156 }
157 const path = "/";
158 const key = v4();
159 currentTabs.value.push({
160 name: path,
161 path,
162 closable: true,
163 key,
164 pushedTime: Date.now()
165 });
166 activeTab.value = key;
167 currentDisk.value = t("TXT_CODE_28124988");
168 handleChangeTab(key);
169 } else {
170 handleRemoveTab(targetKey as string);
171 }
172 };
173
174 const updateBreadcrumbs = (path: string) => {
175 const breadcrumbPaths = parsePath(path);

Callers

nothing calls this directly

Calls 4

handleChangeTabFunction · 0.85
handleRemoveTabFunction · 0.85
warningMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected