code cleanup

This commit is contained in:
2026-02-10 21:59:30 -05:00
parent 6ae35ec636
commit 4f34872f10
5 changed files with 97 additions and 91 deletions

27
app/state.go Normal file
View File

@@ -0,0 +1,27 @@
package main
import "sync"
// Global state management
var (
interactionStates = make(map[string]*InteractionState)
interactionStatesMutex = sync.RWMutex{}
)
func getInteractionState(token string) *InteractionState {
interactionStatesMutex.RLock()
defer interactionStatesMutex.RUnlock()
return interactionStates[token]
}
func setInteractionState(token string, state *InteractionState) {
interactionStatesMutex.Lock()
defer interactionStatesMutex.Unlock()
interactionStates[token] = state
}
func deleteInteractionState(token string) {
interactionStatesMutex.Lock()
defer interactionStatesMutex.Unlock()
delete(interactionStates, token)
}