mirror of
https://github.com/Luzifer/streamdeck.git
synced 2024-12-20 17:51:21 +00:00
Fix: Use proper context for delayed errors
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
5ee7785103
commit
2ada7060ee
1 changed files with 3 additions and 2 deletions
|
@ -231,15 +231,16 @@ func togglePage(page string) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
go func(idx int, kd keyDefinition) {
|
go func(idx int, kd keyDefinition) {
|
||||||
|
localCtx := activePageCtx
|
||||||
keyLogger := log.WithFields(log.Fields{
|
keyLogger := log.WithFields(log.Fields{
|
||||||
"key": idx,
|
"key": idx,
|
||||||
"page": activePageName,
|
"page": activePageName,
|
||||||
})
|
})
|
||||||
|
|
||||||
if err := callDisplayElement(activePageCtx, idx, kd); err != nil {
|
if err := callDisplayElement(localCtx, idx, kd); err != nil {
|
||||||
keyLogger.WithError(err).Error("Unable to execute display element")
|
keyLogger.WithError(err).Error("Unable to execute display element")
|
||||||
|
|
||||||
if err := callErrorDisplayElement(activePageCtx, idx); err != nil {
|
if err := callErrorDisplayElement(localCtx, idx); err != nil {
|
||||||
keyLogger.WithError(err).Error("Unable to execute error display element")
|
keyLogger.WithError(err).Error("Unable to execute error display element")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue