|
@@ -226,6 +226,12 @@ export function useGlobalEvent() {
|
|
|
const notPushType = [MessageType.TypingMessage, MessageType.RevokeMessage];
|
|
|
|
|
|
const newMessageHandler = ({ data }: WSEvent<MessageItem[]>) => {
|
|
|
+ if (window.electronAPI?.showNotification) {
|
|
|
+ window.electronAPI?.showNotification(
|
|
|
+ data[0].senderNickname,
|
|
|
+ data?.[0]?.textElem?.content ?? "",
|
|
|
+ );
|
|
|
+ }
|
|
|
if (syncState === "loading") {
|
|
|
return;
|
|
|
}
|
|
@@ -277,9 +283,6 @@ export function useGlobalEvent() {
|
|
|
|
|
|
// conversation
|
|
|
const conversationChnageHandler = ({ data }: WSEvent<ConversationItem[]>) => {
|
|
|
- if (window.electronAPI?.showNotification) {
|
|
|
- window.electronAPI?.showNotification(data[0].showName, data[0].latestMsg);
|
|
|
- }
|
|
|
updateConversationList(data, "filter");
|
|
|
};
|
|
|
const newConversationHandler = ({ data }: WSEvent<ConversationItem[]>) => {
|