connection workflow

This commit is contained in:
Jan Prochazka
2022-05-19 12:36:15 +02:00
parent 566082d40f
commit 8e5584e90f
5 changed files with 11 additions and 19 deletions

View File

@@ -22,12 +22,14 @@
});
};
export const closeMultipleTabs = closeCondition => {
export const closeMultipleTabs = (closeCondition, deleteFromHistory = false) => {
openedTabs.update(files => {
const newFiles = files.map(x => ({
...x,
closedTime: x.closedTime || (closeCondition(x) ? new Date().getTime() : undefined),
}));
const newFiles = deleteFromHistory
? files.filter(x => !closeCondition(x))
: files.map(x => ({
...x,
closedTime: x.closedTime || (closeCondition(x) ? new Date().getTime() : undefined),
}));
if (newFiles.find(x => x.selected && x.closedTime == null)) {
return newFiles;