Skip to content

Commit

Permalink
GROK-16938: Diff Studio: Fixed recents folder
Browse files Browse the repository at this point in the history
Fixed the recents folder items removal
  • Loading branch information
vmakarichev committed Oct 28, 2024
1 parent cc58179 commit fcbbf6d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/ODEs/src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1520,15 +1520,21 @@ export class DiffStudio {
const newIsCust: boolean[] = [];
const newInfo: string[] = [];
const items = this.recentFolder.items;
let removed = false;

recentInfo.forEach((val, idx) => {
if (val !== info) {
newIsCust.push(recentIsCust[idx]);
newInfo.push(val);
} else
} else {
items[idx].remove();
removed = true;
}
});

if (!removed && items.length >= MAX_RECENT_COUNT)
items[0].remove();

newInfo.push(info);
newIsCust.push(isCustom);

Expand Down

0 comments on commit fcbbf6d

Please sign in to comment.