Fix bug where active session ID is sometimes not persisted (#248)

This commit is contained in:
Evan Simkowitz 2024-01-24 11:32:48 -08:00 committed by GitHub
parent b762df179f
commit 2f57a6e067
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1056,6 +1056,7 @@ func getNextId(ids []string, delId string) string {
}
func SwitchScreenById(ctx context.Context, sessionId string, screenId string) (*ModelUpdate, error) {
SetActiveSessionId(ctx, sessionId)
txErr := WithTx(ctx, func(tx *TxWrap) error {
query := `SELECT screenid FROM screen WHERE sessionid = ? AND screenid = ?`
if !tx.Exists(query, sessionId, screenId) {