fix: heartbeat button shows proper errors instead of failing silently
- CSRF check returns JSON instead of die() with raw text - JS parses non-JSON responses gracefully and shows server error - Visual feedback (check/cross icon) on success/failure - 3-second icon revert after result Claude-Session: https://claude.ai/code/session_01Jo2JpjCwfHAh2HHRSjczKq
This commit is contained in:
@@ -86,7 +86,12 @@ class DisplayController extends BaseController
|
||||
|
||||
public function sendHeartbeat()
|
||||
{
|
||||
Session::checkToken() or die(Text::_('JINVALID_TOKEN'));
|
||||
if (!Session::checkToken())
|
||||
{
|
||||
$this->jsonResponse(['success' => false, 'message' => 'Session expired — please reload the page.']);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user