Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ export const getNotificationRoute = (
case 'TOURNAMENT_RESULT_READY':
return ROUTES.TOURNAMENT_RESULT(refId);
case 'ITEM_PARSING_COMPLETED':
case 'ITEM_PARSING_INCOMPLETE':
case 'ITEM_PARSING_FAILED':
if (extra?.kind === 'TOURNAMENT' && extra.tournamentId) {
return ROUTES.TOURNAMENT_CREATE(extra.tournamentId);
Expand Down
8 changes: 7 additions & 1 deletion apps/web/src/hooks/useNotificationSSE.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ export const useNotificationSSE = (enabled: boolean) => {
}
toast.success(message);
break;
/** 미완성·실패 모두 동일한 데이터를 갱신하고, 사용자 안내만 다르다. */
case 'ITEM_PARSING_INCOMPLETE':
case 'ITEM_PARSING_FAILED':
if (payload.kind === 'TOURNAMENT' && payload.tournamentId != null) {
queryClient.invalidateQueries({
Expand All @@ -178,7 +180,11 @@ export const useNotificationSSE = (enabled: boolean) => {
predicate: query => isWishQueryOfItem(query, payload.refId),
});
}
toast.error(message, { duration: 5000 });
if (payload.type === 'ITEM_PARSING_INCOMPLETE') {
toast.info(message, { duration: 5000 });
} else {
toast.error(message, { duration: 5000 });
}
break;
case 'TOURNAMENT_STARTED':
queryClient.invalidateQueries({ queryKey: ['tournament', payload.refId] });
Expand Down
3 changes: 2 additions & 1 deletion apps/web/src/types/notification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export type NotificationTypeT =
| 'TOURNAMENT_COMPLETED'
| 'TOURNAMENT_RESULT_READY'
| 'ITEM_PARSING_COMPLETED'
| 'ITEM_PARSING_INCOMPLETE'
| 'ITEM_PARSING_FAILED'
| 'ANNOUNCEMENT';

Expand Down Expand Up @@ -40,7 +41,7 @@ export type SilentSyncSsePayloadT =
type: 'TOURNAMENT_ITEM_PARSED';
tournamentId: number;
tournamentItemId: number;
status: 'READY' | 'FAILED';
status: 'READY' | 'INCOMPLETE' | 'FAILED';
}
| {
type: 'UNREAD_COUNT_CHANGED';
Expand Down
1 change: 1 addition & 0 deletions apps/web/src/utils/pushNotificationRoute.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const getPushNotificationRoute = (payload: DeepLinkPayloadT) => {
case PUSH_NOTIFICATION_TYPE.TOURNAMENT_ITEM_ADDED:
return ROUTES.TOURNAMENT_CREATE(payload.refId);
case PUSH_NOTIFICATION_TYPE.ITEM_PARSING_COMPLETED:
case PUSH_NOTIFICATION_TYPE.ITEM_PARSING_INCOMPLETE:
case PUSH_NOTIFICATION_TYPE.ITEM_PARSING_FAILED:
if (payload.kind === 'TOURNAMENT' && payload.tournamentId) {
return ROUTES.TOURNAMENT_CREATE(payload.tournamentId);
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/consts/webBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ export const PUSH_NOTIFICATION_TYPE = {
TOURNAMENT_JOINED: 'TOURNAMENT_JOINED',
TOURNAMENT_ITEM_ADDED: 'TOURNAMENT_ITEM_ADDED',
ITEM_PARSING_COMPLETED: 'ITEM_PARSING_COMPLETED',
ITEM_PARSING_INCOMPLETE: 'ITEM_PARSING_INCOMPLETE',
ITEM_PARSING_FAILED: 'ITEM_PARSING_FAILED',
} as const;

Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/types/pushNotification.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export type DeepLinkPayloadT =
refId: number;
}
| {
type: 'ITEM_PARSING_COMPLETED' | 'ITEM_PARSING_FAILED';
type: 'ITEM_PARSING_COMPLETED' | 'ITEM_PARSING_INCOMPLETE' | 'ITEM_PARSING_FAILED';
refId: number;
kind: 'WISH' | 'TOURNAMENT';
tournamentId?: number;
Expand Down
Loading