[Library | Trunk]: Add setItem to localStorage for directLink.
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@58989 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
16b1903d3c
commit
409231cef6
|
@ -11,7 +11,7 @@ export class LocalStorageService {
|
||||||
|
|
||||||
constructor(@Inject(PLATFORM_ID) private platformId: string) {
|
constructor(@Inject(PLATFORM_ID) private platformId: string) {
|
||||||
if(isPlatformBrowser(this.platformId)) {
|
if(isPlatformBrowser(this.platformId)) {
|
||||||
let item = localStorage.getItem('communityDirectLink');
|
let item = localStorage.getItem('directLink');
|
||||||
if(item !== null) {
|
if(item !== null) {
|
||||||
this.communityDirectLink = new BehaviorSubject<boolean>(item == 'true');
|
this.communityDirectLink = new BehaviorSubject<boolean>(item == 'true');
|
||||||
} else {
|
} else {
|
||||||
|
@ -22,6 +22,7 @@ export class LocalStorageService {
|
||||||
|
|
||||||
public setCommunityDirectLink(value: string) {
|
public setCommunityDirectLink(value: string) {
|
||||||
this.communityDirectLink.next(Boolean(value).valueOf());
|
this.communityDirectLink.next(Boolean(value).valueOf());
|
||||||
|
localStorage.setItem('directLink', value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public get(): Observable<boolean> {
|
public get(): Observable<boolean> {
|
||||||
|
|
Loading…
Reference in New Issue