From 381f67f93b799eccd2021e720c32c690356cef60 Mon Sep 17 00:00:00 2001 From: "Jesse C. Fisher" Date: Sun, 20 Apr 2025 18:13:49 -0700 Subject: [PATCH] If not turn poll table --- app/assets/javascripts/application.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index e1fcb680..12ee8eea 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -21,10 +21,12 @@ // require_tree . +// // If not your turn, poll the table $(document).ready(function(){ setInterval(function() { - // $('#table-component').load("#{request.path} #table-component"); - $('#play-to-beat').load("#{request.path} #play-to-beat"); - $('#play-buttons').load("#{request.path} #play-buttons"); + if ( $('.taking-turn.player[data-soft-token=' + soft_token + ']').length < 1 ) { + $('#flash_message').load(window.location.pathname +" #flash_message"); + $('#table-component').load(window.location.pathname +" #table-component"); + } }, 2000); });