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