Poprawka botto bar i wersje językowe
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
const API_URL = '../../api/waiter_feed.php';
|
||||
const POLL_MS = 15000;
|
||||
const FEED_TOKEN = String(window.WAITER_CONFIG?.feedToken || '');
|
||||
|
||||
const feedList = document.getElementById('feedList');
|
||||
const emptyState = document.getElementById('emptyState');
|
||||
@@ -238,7 +239,10 @@ function setSyncState(ok, message) {
|
||||
|
||||
async function pollFeed() {
|
||||
try {
|
||||
const response = await fetch(API_URL, { cache: 'no-store' });
|
||||
const response = await fetch(API_URL, {
|
||||
cache: 'no-store',
|
||||
headers: FEED_TOKEN ? { 'X-Waiter-Token': FEED_TOKEN } : {},
|
||||
});
|
||||
const result = await response.json();
|
||||
|
||||
if (result.status !== 'success') {
|
||||
|
||||
@@ -3,6 +3,8 @@ require_once __DIR__ . '/../includes/asset_version.php';
|
||||
$waiterDir = __DIR__;
|
||||
$vCss = publicAssetVersion($waiterDir, 'app.css');
|
||||
$vJs = publicAssetVersion($waiterDir, 'app.js');
|
||||
$waiterConfig = require __DIR__ . '/../../config/waiter.php';
|
||||
$waiterFeedToken = (string) ($waiterConfig['feed_token'] ?? '');
|
||||
?><!DOCTYPE html>
|
||||
<html lang="pl">
|
||||
<head>
|
||||
@@ -19,6 +21,9 @@ $vJs = publicAssetVersion($waiterDir, 'app.js');
|
||||
<link rel="apple-touch-icon" href="icons/icon-192.png">
|
||||
<link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;600;700;800&display=swap" rel="stylesheet">
|
||||
<link rel="stylesheet" href="app.css?v=<?= assetVersionAttr($vCss) ?>">
|
||||
<script>
|
||||
window.WAITER_CONFIG = <?= json_encode(['feedToken' => $waiterFeedToken], JSON_UNESCAPED_UNICODE | JSON_HEX_TAG | JSON_HEX_AMP | JSON_HEX_APOS) ?>;
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<header class="top-bar">
|
||||
|
||||
Reference in New Issue
Block a user