Skip to content

Commit

Permalink
Add t param on signage view to bust cache (#422)
Browse files Browse the repository at this point in the history
* Add t param on signage view to bust cache

Signed-off-by: Tomás Castillo <[email protected]>

* Set param on get templates action

Signed-off-by: Tomás Castillo <[email protected]>

* Remove unnecesary import

Signed-off-by: Tomás Castillo <[email protected]>

---------

Signed-off-by: Tomás Castillo <[email protected]>
  • Loading branch information
tomrndom authored Jun 3, 2024
1 parent 1e8b1b9 commit 2ec9009
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/actions/signage-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ import {
} from 'openstack-uicore-foundation/lib/utils/actions';
import {getAccessTokenSafely} from '../utils/methods';
import Ably from "ably";
import moment from 'moment-timezone';
import T from "i18n-react";
import Swal from "sweetalert2";

Expand Down Expand Up @@ -99,8 +100,10 @@ export const getSign = (locationId) => async (dispatch, getState) => {
export const getTemplates = () => async (dispatch, getState) => {
const {currentSummitState} = getState();
const {currentSummit} = currentSummitState;

const now = moment().tz(currentSummit.time_zone_id).unix();

const response = await fetch(`${window.SIGNAGE_BASE_URL}/templates.json`);
const response = await fetch(`${window.SIGNAGE_BASE_URL}/templates.json?t=${now}`);
if (response.ok) {
const clients = await response.json();
let templates = [];
Expand Down
2 changes: 1 addition & 1 deletion src/pages/signage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ const SignagePage = ({
props.publishDate(jumpDate, "signage.date_published");
}

const viewSign = () => {
const viewSign = () => {
window.open(`${window.SIGNAGE_BASE_URL}/${sign?.template}#/?summit=${summit.id}&location=${locationId}`);
};

Expand Down

0 comments on commit 2ec9009

Please sign in to comment.