Skip to content

Commit

Permalink
Fix multiple plots removed on single remove (posit-dev#3236)
Browse files Browse the repository at this point in the history
Remove plots list update now that the close event is correctly triggered to run clean up
  • Loading branch information
timtmok authored May 22, 2024
1 parent 49d216f commit 0a55fdd
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -631,13 +631,11 @@ export class PositronPlotsService extends Disposable implements IPositronPlotsSe
* @param id The ID of the plot to remove
*/
removePlot(id: string): void {
// Find the plot with the given ID and remove it from the list
// Find the plot with the given ID and dispose it
// It will be automatically removed from the list during onDidClose
this._plots.forEach((plot, index) => {
if (plot.id === id) {
plot.dispose();

// Remove the plot from the list
this._plots.splice(index, 1);
}
});

Expand Down

0 comments on commit 0a55fdd

Please sign in to comment.