Skip to content

Commit 0f14860

Browse files
author
Jicheng Lu
committed
add new window
1 parent 76b215e commit 0f14860

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/lib/common/LiveChatEntry.svelte

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@
3737
showBubbleMsg = false;
3838
receivedMsg = '';
3939
}, receivedMsg?.length > 200 ? 8000 : 3000);
40+
} else if (e.data.action == ChatAction.NewWindow && e.data.url) {
41+
window.open(e.data.url, '_blank');
4042
}
4143
};
4244

src/lib/helpers/enums.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,8 @@ const chatAction = {
167167
Logout: 'logout',
168168
Chat: 'chat',
169169
NewChat: 'new-chat',
170-
ReceiveNotification: 'receive-notification'
170+
ReceiveNotification: 'receive-notification',
171+
NewWindow: 'new-window',
171172
};
172173
export const ChatAction = Object.freeze(chatAction);
173174

0 commit comments

Comments
 (0)