Skip to content

Commit

Permalink
only show news if license has been confirmed (#2134)
Browse files Browse the repository at this point in the history
- closes #2133
  • Loading branch information
foxriver76 authored Sep 28, 2023
1 parent f959b0e commit 2e97029
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -958,7 +958,7 @@ class App extends Router {
`admin.${instance}.info.newsFeed`,
this.getNews(instance),
)),
5000,
5_000,
);

setTimeout(
Expand Down Expand Up @@ -1213,7 +1213,7 @@ class App extends Router {
for (let instance = 0; instance < maxCount; instance++) {
try {
const adminAlive = await this.socket.getState(`system.adapter.admin.${instance}.alive`);
if (adminAlive && adminAlive.val) {
if (adminAlive?.val) {
resolve(instance);
break;
}
Expand Down Expand Up @@ -1263,6 +1263,10 @@ class App extends Router {
*/
getNews = instance => async (name, newsFeed) => {
try {
if (!this.state.systemConfig.common.licenseConfirmed) {
return;
}

const lastNewsId = await this.socket.getState(`admin.${instance}.info.newsLastId`);
if (newsFeed?.val) {
let news = null;
Expand Down

0 comments on commit 2e97029

Please sign in to comment.