From 95903269b252729ee6573a5b607d98fa0223cd9a Mon Sep 17 00:00:00 2001
From: nsfisis <nsfisis@gmail.com>
Date: Fri, 21 Mar 2025 11:37:48 +0900
Subject: fix(frontend): fix submission status flickering

---
 backend/query.sql | 6 ++++++
 1 file changed, 6 insertions(+)

(limited to 'backend/query.sql')

diff --git a/backend/query.sql b/backend/query.sql
index 32f9273..2d56c1c 100644
--- a/backend/query.sql
+++ b/backend/query.sql
@@ -156,6 +156,12 @@ VALUES ($1, $2, $3, $4)
 ON CONFLICT (game_id, user_id)
 DO UPDATE SET code = EXCLUDED.code;
 
+-- name: UpdateCodeAndStatus :exec
+INSERT INTO game_states (game_id, user_id, code, status)
+VALUES ($1, $2, $3, $4)
+ON CONFLICT (game_id, user_id)
+DO UPDATE SET code = EXCLUDED.code, status = EXCLUDED.status;
+
 -- name: CreateSubmission :one
 INSERT INTO submissions (game_id, user_id, code, code_size, status)
 VALUES ($1, $2, $3, $4, 'running')
-- 
cgit v1.2.3-70-g09d2

