You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Then DynamicLayoutComponent didn't work fine when first time to load page:
2.something wrong withGetAppConfiguration Action
@Action(GetAppConfiguration)addData({ patchState, dispatch }: StateContext<Config.State>){constapiName='default';constapi=this.store.selectSnapshot(ConfigState.getApiUrl(apiName));returnthis.http.get<ApplicationConfiguration.Response>(`${api}/api/abp/application-configuration`).pipe(tap(configuration=>patchState({
...configuration,}),),switchMap(configuration=>{letdefaultLang: string=configuration.setting.values['Abp.Localization.DefaultLanguage'];if(defaultLang.includes(';')){defaultLang=defaultLang.split(';')[0];}document.documentElement.setAttribute('lang',configuration.localization.currentCulture.cultureName,);returnthis.store.selectSnapshot(SessionState.getLanguage)
? of(null)//=>OK:works fine
: dispatch(newSetLanguage(defaultLang,false));//=>NG:first time load page will return this }),catchError((err: HttpErrorResponse)=>{dispatch(newRestOccurError(err));returnthrowError(err);}),);}
According to above code,
if addData(GetAppConfiguration Action) method finally return of(null) it will works perfect
but if it return dispatch(new SetLanguage(defaultLang, false)) ,will must have this error.
I think this bug is about ngxs/store,but in a angular app ,APP_INITIALIZER is a very often used,
Could you help me to check this? thank you
The text was updated successfully, but these errors were encountered:
yinchang0626
changed the title
[angular bug] DynamicLayoutComponent didn't work when with a long time APP_INITIALIZER
[angular] DynamicLayoutComponent didn't work when with a long time APP_INITIALIZER
Aug 30, 2020
@mehmet-erim :Hi,
I think I find a bug about
GetAppConfiguration
Action and create a branch to test it1.Add a
APP_INITIALIZER
provider to AppModule:Then
DynamicLayoutComponent
didn't work fine when first time to load page:2.something wrong with
GetAppConfiguration
ActionAccording to above code,
if
addData
(GetAppConfiguration Action) method finally returnof(null)
it will works perfectbut if it return
dispatch(new SetLanguage(defaultLang, false))
,will must have this error.I think this bug is about
ngxs/store
,but in a angular app ,APP_INITIALIZER
is a very often used,Could you help me to check this? thank you
The text was updated successfully, but these errors were encountered: