aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/client/views/DocumentDecorations.tsx9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/client/views/DocumentDecorations.tsx b/src/client/views/DocumentDecorations.tsx
index 2914e5ad4..def2be848 100644
--- a/src/client/views/DocumentDecorations.tsx
+++ b/src/client/views/DocumentDecorations.tsx
@@ -151,11 +151,12 @@ export class DocumentDecorations extends React.Component<{ PanelWidth: number, P
if (this.canDelete) {
const views = SelectionManager.Views().slice().filter(v => v);
if (force) this._deleteAfterIconify = true;
- if (!this._iconifyBatch) this._iconifyBatch = UndoManager.StartBatch("iconifying");
- else this._deleteAfterIconify = true;
- this._iconifyingCount = views.length;
+ if (!this._iconifyBatch) {
+ this._iconifyBatch = UndoManager.StartBatch("iconifying");
+ this._iconifyingCount = force ? 1 : views.length;
+ } else this._deleteAfterIconify = true;
const finished = () => {
- if (this._deleteAfterIconify || --this._iconifyingCount <= 0) {
+ if (--this._iconifyingCount <= 0) {
this._iconifyingCount = 0;
SelectionManager.DeselectAll();
if (this._deleteAfterIconify) views.forEach(iconView => iconView.props.removeDocument?.(iconView.props.Document));