Skip to content

Commit

Permalink
AppNews can only appear in production mode
Browse files Browse the repository at this point in the history
  • Loading branch information
mertsincan committed Oct 25, 2022
1 parent 1d5c37f commit 5418ae0
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions src/app/showcase/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { Component, OnInit, OnDestroy } from '@angular/core';
import { Component, OnDestroy, OnInit } from '@angular/core';
import { Subscription } from 'rxjs';
import { environment } from 'src/environments/environment';
import { AppConfig } from './domain/appconfig';
import { AppConfigService } from './service/appconfigservice';
import { JsonService } from './service/jsonservice';
Expand Down Expand Up @@ -31,19 +32,21 @@ export class AppComponent implements OnInit, OnDestroy {
this.config = config;
});

this.JsonService.getAnnouncement().then((data) => {
this.announcement = data;

const itemString = localStorage.getItem(this.storageKey);
if (itemString) {
const item = JSON.parse(itemString);
if (item.hiddenNews && item.hiddenNews !== data.id) {
if (environment.production) {
this.JsonService.getAnnouncement().then((data) => {
this.announcement = data;

const itemString = localStorage.getItem(this.storageKey);
if (itemString) {
const item = JSON.parse(itemString);
if (item.hiddenNews && item.hiddenNews !== data.id) {
this.newsActive = true;
}
} else {
this.newsActive = true;
}
} else {
this.newsActive = true;
}
});
});
}
}

onNewsClose() {
Expand Down

0 comments on commit 5418ae0

Please sign in to comment.