이미 열린 방에 대해서 다시 열고자 할때 갱신하지 않도록 수정. ChatStore.selectedRoom effect 수정.
This commit is contained in:
parent
97befdc860
commit
81866a23fb
|
@ -21,6 +21,8 @@ export const clearSelectedRoom = createAction(
|
||||||
'[Messenger::Chat] clearSelectedRoom'
|
'[Messenger::Chat] clearSelectedRoom'
|
||||||
);
|
);
|
||||||
|
|
||||||
|
export const clearEvent = createAction('[Messenger::Room] Clear Event');
|
||||||
|
|
||||||
export const newEventMessage = createAction(
|
export const newEventMessage = createAction(
|
||||||
'[Messenger::Chat] newEventMessage',
|
'[Messenger::Chat] newEventMessage',
|
||||||
props<{
|
props<{
|
||||||
|
|
|
@ -144,7 +144,7 @@ export const reducer = createReducer(
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
|
|
||||||
on(ChatStore.selectedRoom, (state, action) => {
|
on(ChatStore.clearEvent, (state, action) => {
|
||||||
return {
|
return {
|
||||||
...initialState
|
...initialState
|
||||||
};
|
};
|
||||||
|
|
|
@ -76,20 +76,35 @@ import { LoginInfo, KEY_LOGIN_INFO } from '@app/types';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class Effects {
|
export class Effects {
|
||||||
selectedRoomForInfo$ = createEffect(() =>
|
selectedRoomForInfo$ = createEffect(
|
||||||
this.actions$.pipe(
|
() => {
|
||||||
ofType(ChatStore.selectedRoom),
|
return this.actions$.pipe(
|
||||||
map(action => {
|
ofType(ChatStore.selectedRoom),
|
||||||
const loginInfo = this.sessionStorageService.get<LoginInfo>(
|
withLatestFrom(
|
||||||
KEY_LOGIN_INFO
|
this.store.pipe(
|
||||||
);
|
select((state: any) => state.messenger.room.roomInfo as RoomInfo)
|
||||||
return info({
|
)
|
||||||
roomSeq: action.roomSeq,
|
),
|
||||||
isDetail: true,
|
map(([action, roomInfo]) => {
|
||||||
localeCode: loginInfo.localeCode
|
if (!!roomInfo && roomInfo.roomSeq === action.roomSeq) {
|
||||||
});
|
} else {
|
||||||
})
|
this.store.dispatch(ChatStore.clearEvent());
|
||||||
)
|
|
||||||
|
const loginInfo = this.sessionStorageService.get<LoginInfo>(
|
||||||
|
KEY_LOGIN_INFO
|
||||||
|
);
|
||||||
|
this.store.dispatch(
|
||||||
|
info({
|
||||||
|
roomSeq: action.roomSeq,
|
||||||
|
isDetail: true,
|
||||||
|
localeCode: loginInfo.localeCode
|
||||||
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
);
|
||||||
|
},
|
||||||
|
{ dispatch: false }
|
||||||
);
|
);
|
||||||
|
|
||||||
info$ = createEffect(
|
info$ = createEffect(
|
||||||
|
|
Loading…
Reference in New Issue
Block a user