순환참조 오류 수정.

This commit is contained in:
leejinho 2019-12-09 18:50:42 +09:00
parent 2dcd0036d0
commit dfde4bf491
2 changed files with 91 additions and 89 deletions

View File

@ -266,35 +266,6 @@ export class Effects {
})
)
);
inviteSuccess$ = createEffect(() =>
this.actions$.pipe(
ofType(inviteSuccess),
withLatestFrom(
this.store.pipe(
select((state: any) => state.messenger.room.roomInfo as RoomInfo)
),
this.store.pipe(
select(AppStore.MessengerSelector.SyncSelector.selectRoomSyncDate)
)
),
map(([action, roomInfo, roomSyncDate]) => {
const loginInfo = this.sessionStorageService.get<LoginInfo>(
KEY_LOGIN_INFO
);
this.store.dispatch(
SyncStore.room({
syncDate: roomSyncDate,
localeCode: loginInfo.localeCode
})
);
if (!!roomInfo && roomInfo.roomSeq === action.roomSeq) {
return ChatStore.selectedRoom({ roomSeq: action.roomSeq });
}
})
)
);
exit$ = createEffect(() =>
this.actions$.pipe(
@ -354,66 +325,6 @@ export class Effects {
},
{ dispatch: false }
);
exitForcingNotificationRes$ = createEffect(
() => {
return this.actions$.pipe(
ofType(exitForcingNotificationRes),
withLatestFrom(
this.store.pipe(
select((state: any) => state.messenger.room.roomInfo as RoomInfo)
),
this.store.pipe(
select(AppStore.MessengerSelector.SyncSelector.selectRoomSyncDate)
)
),
tap(([action, roomInfo, roomSyncDate]) => {
if (!!roomInfo && roomInfo.roomSeq === action.noti.roomSeq) {
this.store.dispatch(
ChatStore.selectedRoom({ roomSeq: action.noti.roomSeq })
);
}
const loginInfo = this.sessionStorageService.get<LoginInfo>(
KEY_LOGIN_INFO
);
this.store.dispatch(
SyncStore.room({
syncDate: roomSyncDate,
localeCode: loginInfo.localeCode
})
);
})
);
},
{ dispatch: false }
);
exitForcingNotificationNoti$ = createEffect(
() => {
return this.actions$.pipe(
ofType(exitForcingNotificationNoti),
withLatestFrom(
this.store.pipe(
select((state: any) => state.messenger.room.roomInfo as RoomInfo)
)
),
tap(([action, roomInfo]) => {
if (!!roomInfo && roomInfo.roomSeq === action.noti.roomSeq) {
this.store.dispatch(ChatStore.clearSelectedRoom());
}
this.store.dispatch(
exitSuccess({
res: {
roomSeq: action.noti.roomSeq
}
})
);
})
);
},
{ dispatch: false }
);
updateFontNotification$ = createEffect(
() => {

View File

@ -472,6 +472,97 @@ export class Effects {
{ dispatch: false }
);
inviteSuccess$ = createEffect(() =>
this.actions$.pipe(
ofType(RoomStore.inviteSuccess),
withLatestFrom(
this.store.pipe(
select((state: any) => state.messenger.room.roomInfo as RoomInfo)
),
this.store.pipe(
select((state: any) => state.messenger.sync.room.syncDate as string)
)
),
map(([action, roomInfo, roomSyncDate]) => {
const loginInfo = this.sessionStorageService.get<LoginInfo>(
KEY_LOGIN_INFO
);
this.store.dispatch(
room({
syncDate: roomSyncDate,
localeCode: loginInfo.localeCode
})
);
if (!!roomInfo && roomInfo.roomSeq === action.roomSeq) {
return ChatStore.selectedRoom({ roomSeq: action.roomSeq });
}
})
)
);
exitForcingNotificationRes$ = createEffect(
() => {
return this.actions$.pipe(
ofType(RoomStore.exitForcingNotificationRes),
withLatestFrom(
this.store.pipe(
select((state: any) => state.messenger.room.roomInfo as RoomInfo)
),
this.store.pipe(
select((state: any) => state.messenger.sync.room.syncDate as string)
)
),
tap(([action, roomInfo, roomSyncDate]) => {
if (!!roomInfo && roomInfo.roomSeq === action.noti.roomSeq) {
this.store.dispatch(
ChatStore.selectedRoom({ roomSeq: action.noti.roomSeq })
);
}
const loginInfo = this.sessionStorageService.get<LoginInfo>(
KEY_LOGIN_INFO
);
this.store.dispatch(
room({
syncDate: roomSyncDate,
localeCode: loginInfo.localeCode
})
);
})
);
},
{ dispatch: false }
);
exitForcingNotificationNoti$ = createEffect(
() => {
return this.actions$.pipe(
ofType(RoomStore.exitForcingNotificationNoti),
withLatestFrom(
this.store.pipe(
select((state: any) => state.messenger.room.roomInfo as RoomInfo)
)
),
tap(([action, roomInfo]) => {
if (!!roomInfo && roomInfo.roomSeq === action.noti.roomSeq) {
this.store.dispatch(ChatStore.clearSelectedRoom());
}
this.store.dispatch(
RoomStore.exitSuccess({
res: {
roomSeq: action.noti.roomSeq
}
})
);
})
);
},
{ dispatch: false }
);
createGroup$ = createEffect(() =>
this.actions$.pipe(
ofType(createGroup),