mirror of
https://github.com/Eugeny/tabby.git
synced 2025-07-21 02:48:00 +00:00
@@ -138,6 +138,7 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
private spinnerActive = false
|
private spinnerActive = false
|
||||||
|
private spinnerPaused = false
|
||||||
private toolbarRevealTimeout = new ResettableTimeout(() => {
|
private toolbarRevealTimeout = new ResettableTimeout(() => {
|
||||||
this.revealToolbar = false
|
this.revealToolbar = false
|
||||||
}, 1000)
|
}, 1000)
|
||||||
@@ -760,7 +761,7 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected startSpinner (text?: string): void {
|
protected startSpinner (text?: string): void {
|
||||||
if (this.spinnerActive) {
|
if (this.spinnerActive || this.spinnerPaused) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if (text) {
|
if (text) {
|
||||||
@@ -782,11 +783,19 @@ export class BaseTerminalTabComponent extends BaseTabComponent implements OnInit
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected async withSpinnerPaused (work: () => any): Promise<void> {
|
protected async withSpinnerPaused (work: () => any): Promise<void> {
|
||||||
const wasActive = this.spinnerActive
|
this.spinnerPaused = true
|
||||||
this.stopSpinner()
|
if (this.spinnerActive) {
|
||||||
|
this.spinner.stop(true)
|
||||||
|
}
|
||||||
|
try {
|
||||||
await work()
|
await work()
|
||||||
if (wasActive) {
|
} finally {
|
||||||
this.startSpinner()
|
this.spinnerPaused = false
|
||||||
|
if (this.spinnerActive) {
|
||||||
|
this.zone.runOutsideAngular(() => {
|
||||||
|
this.spinner.start()
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user