removed the countdown from the BufferStarted notification

This commit is contained in:
2026-03-30 13:48:56 -07:00
parent 41fc743026
commit a7fbf3bc22

View File

@@ -143,20 +143,25 @@ if ($Type -eq 'BufferStarted') {
$txtBody.Inlines.Add("`n`nIT can retrieve this file if needed for a support case.")
}
# Countdown timer — auto-dismisses after 30 seconds
# Use a hashtable for shared state so the closure captures it by reference correctly
$state = @{ Tick = 30 }
$btnOK.Content = 'OK (30)'
$timer = New-Object System.Windows.Threading.DispatcherTimer
$timer.Interval = [TimeSpan]::FromSeconds(1)
$timer.Add_Tick({
if ($Type -eq 'ReplaySaved') {
# Countdown timer — auto-dismisses after 30 seconds
# Use a hashtable for shared state so the closure captures it by reference correctly
$state = @{ Tick = 30 }
$btnOK.Content = 'OK (30)'
$timer = New-Object System.Windows.Threading.DispatcherTimer
$timer.Interval = [TimeSpan]::FromSeconds(1)
$timer.Add_Tick({
$state.Tick--
$btnOK.Content = "OK ($($state.Tick))"
if ($state.Tick -le 0) {
$timer.Stop()
$window.Close()
}
}.GetNewClosure())
$timer.Start()
$btnOK.Add_Click({ $timer.Stop(); $window.Close() }.GetNewClosure())
}.GetNewClosure())
$timer.Start()
$btnOK.Add_Click({ $timer.Stop(); $window.Close() }.GetNewClosure())
} else {
$btnOK.Content = 'OK'
$btnOK.Add_Click({ $window.Close() }.GetNewClosure())
}
$window.ShowDialog() | Out-Null