Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
L140-beep committed Mar 4, 2025
1 parent 860e12c commit c1718f2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/renderer/src/store/useTabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,15 @@ export const useTabs = create<TabsState>((set) => ({
},
openTab: (modelController, tab) =>
set(({ items }) => {
if (tab.type === 'editor') {
modelController.model.changeHeadControllerId(tab.canvasId);
}

// Если пытаемся открыть одну и ту же вкладку
if (items.find(({ name }) => name === tab.name)) {
return { activeTab: tab.name };
}

if (tab.type === 'editor') {
modelController.model.changeHeadControllerId(tab.canvasId);
}

return {
items: [...items, tab],
activeTab: tab.name,
Expand Down

0 comments on commit c1718f2

Please sign in to comment.