Fixes issue in the frontend node server

parent 638f4fce
Pipeline #17948 passed with stages
in 8 minutes and 44 seconds
import { Injectable } from '@angular/core';
import { isPlatformServer } from '@angular/common';
import { Inject, Injectable, PLATFORM_ID } from '@angular/core';
import { Observable } from 'rxjs';
import { DB_NAME, DB_TABLE, STORAGE_KEY } from '../../shared/enums';
import { IndexedDbService } from './indexed.db.service';
......@@ -8,7 +9,12 @@ import { IndexedDbService } from './indexed.db.service';
})
export class StorageService {
constructor(private indexedDbService: IndexedDbService) {
constructor(@Inject(PLATFORM_ID) private platformId: Object, private indexedDbService: IndexedDbService) {
if (isPlatformServer(this.platformId)) {
return;
}
this.indexedDbService.setName(DB_NAME.DEFAULT);
this.indexedDbService.create([
{ name: DB_TABLE.CONFIG }, {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment