Skip to content

Commit

Permalink
[ZEPPELIN-6097] fix: Error popup appears twice, and CSS is broken (0.…
Browse files Browse the repository at this point in the history
…11.2)
  • Loading branch information
dididy committed Oct 14, 2024
1 parent bdf5b06 commit 67bec5c
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions zeppelin-web-angular/src/app/app-message.interceptor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ export class AppMessageInterceptor implements MessageInterceptor {
private router: Router,
private nzNotificationService: NzNotificationService,
private ticketService: TicketService,
private nzModalService: NzModalService
private nzModalService: NzModalService,
private prevErrorInfo: string
) {}

received<T extends keyof MessageReceiveDataTypeMap>(data: WebSocketMessage<T>): WebSocketMessage<T> {
Expand Down Expand Up @@ -60,8 +61,18 @@ export class AppMessageInterceptor implements MessageInterceptor {
} else if (data.op === OP.ERROR_INFO) {
// tslint:disable-next-line:no-any
const rData = (data.data as any) as MessageReceiveDataTypeMap[OP.ERROR_INFO];
if (rData.info) {
this.nzNotificationService.warning('ERROR', rData.info);
const isDuplicateError = this.prevErrorInfo === rData.info;

if (!isDuplicateError && rData.info) {
this.nzNotificationService.warning('ERROR', rData.info, {
nzStyle: { wordWrap: 'break-word' }
});
this.prevErrorInfo = rData.info;
}
if (isDuplicateError) {
setTimeout(() => {
this.prevErrorInfo = null;
}, 500);
}
}
return data;
Expand Down

0 comments on commit 67bec5c

Please sign in to comment.