Skip to content

Commit

Permalink
fix: add pane logic
Browse files Browse the repository at this point in the history
  • Loading branch information
felixroos committed Feb 16, 2025
1 parent 887b736 commit 64fbbe8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,10 @@ document.getElementById('add-pane-button')?.addEventListener('click', () => {
console.error('cannot add more than 8 panes');
return;
}
const nextID = [1, 2, 3, 4, 5, 6, 7, 8].find((number) => !documents.find((doc) => Number(doc.id) === number));
const newDocs = [
...documents.map((doc) => ({ id: doc.id, target: doc.target })),
{ id: String(documents.length + 1), target: 'strudel' },
{ id: nextID + '', target: 'strudel' },
];
session.setActiveDocuments(newDocs);
});
Expand Down

0 comments on commit 64fbbe8

Please sign in to comment.