File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change 11import { isPlatformServer } from '@angular/common' ;
22import type { ModuleWithProviders } from '@angular/core' ;
3- import { InjectionToken , NgModule } from '@angular/core' ;
3+ import { InjectionToken , NgModule , PLATFORM_ID } from '@angular/core' ;
44import { Storage , StorageConfig } from '@ionic/storage' ;
55
66const StorageConfigToken = new InjectionToken < any > ( 'STORAGE_CONFIG_TOKEN' ) ;
@@ -45,8 +45,8 @@ class NoopStorage extends Storage {
4545 setEncryptionKey ( key : string ) { }
4646}
4747
48- export function provideStorage ( storageConfig : StorageConfig ) : Storage {
49- if ( isPlatformServer ( this . platformId ) ) {
48+ export function provideStorage ( platformId : any , storageConfig : StorageConfig ) : Storage {
49+ if ( isPlatformServer ( platformId ) ) {
5050 // When running in a server context return the NoopStorage
5151 return new NoopStorage ( ) ;
5252 }
@@ -64,7 +64,7 @@ export class IonicStorageModule {
6464 {
6565 provide : Storage ,
6666 useFactory : provideStorage ,
67- deps : [ StorageConfigToken ] ,
67+ deps : [ PLATFORM_ID , StorageConfigToken ] ,
6868 } ,
6969 ] ,
7070 } ;
You can’t perform that action at this time.
0 commit comments