diff --git a/CHANGELOG.md b/CHANGELOG.md index fa307b15..94f656e4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,8 @@ All notable changes to this project will be documented in this file. - Winston logging to Pino logging - Set infrastructure node version to 20. - Fixed base path to /client. +- [#118](https://github.com/os2display/display-client/pull/118) + - Added api url to localstorage. ## [2.0.4] - 2024-08-14 @@ -44,7 +46,8 @@ All notable changes to this project will be documented in this file. - [#119](https://github.com/os2display/display-client/pull/119) - Changed to v2 routing. -- Limited the number of API calls by comparing relationsChecksum. +- [#117](https://github.com/os2display/display-client/pull/117) + - Limited the number of API calls by comparing relationsChecksum. ## [1.3.5] - 2023-09-14 diff --git a/src/app.jsx b/src/app.jsx index 1431b59f..2232a328 100644 --- a/src/app.jsx +++ b/src/app.jsx @@ -406,6 +406,9 @@ function App() { const tenantKey = localStorage.getItem(localStorageKeys.TENANT_KEY); const tenantId = localStorage.getItem(localStorageKeys.TENANT_ID); + // Make api endpoint available through localstorage. + localStorage.setItem(localStorageKeys.API_URL, config.apiEndpoint); + if (token && tenantKey && tenantId) { // Get fallback image. fetch(`${config.apiEndpoint}/v2/tenants/${tenantId}`, { diff --git a/src/local-storage-keys.js b/src/local-storage-keys.js index 2a737c41..a7f2ed7b 100644 --- a/src/local-storage-keys.js +++ b/src/local-storage-keys.js @@ -7,5 +7,6 @@ const localStorageKeys = { TENANT_ID: 'tenantId', REFRESH_TOKEN: 'refreshToken', FALLBACK_IMAGE: 'fallbackImage', + API_URL: 'apiUrl', }; export default localStorageKeys;