대화 뱃지가 남아 있을 경우 계속 taskbar 에 blink 하도록 수정.
This commit is contained in:
parent
020f905e93
commit
ca9e8942e7
|
@ -89,7 +89,7 @@ export class AppWindow {
|
|||
// windows Focus or Blur state detacted.
|
||||
this.window.on(ElectronBrowserWindowChannel.Focus, () => {
|
||||
if (__WIN32__) {
|
||||
this.window.flashFrame(false);
|
||||
// this.window.flashFrame(false);
|
||||
}
|
||||
|
||||
this.window.webContents.send(
|
||||
|
|
|
@ -8,7 +8,8 @@ import {
|
|||
dialog,
|
||||
BrowserWindow,
|
||||
clipboard,
|
||||
crashReporter
|
||||
crashReporter,
|
||||
nativeImage
|
||||
} from 'electron';
|
||||
import path from 'path';
|
||||
import fse from 'fs-extra';
|
||||
|
@ -35,7 +36,8 @@ import {
|
|||
MessageChannel,
|
||||
AppChannel,
|
||||
ClipboardChannel,
|
||||
ExternalChannel
|
||||
ExternalChannel,
|
||||
WindowStateChannel
|
||||
} from '@ucap-webmessenger/native-electron';
|
||||
import { ElectronNotificationService } from '@ucap-webmessenger/electron-notification';
|
||||
import { ElectronUpdateWindowService } from '@ucap-webmessenger/electron-update-window';
|
||||
|
@ -800,7 +802,7 @@ ipcMain.on(
|
|||
: '',
|
||||
displayTime: !!noti.displayTime ? noti.displayTime : undefined,
|
||||
onClick: e => {
|
||||
appWindow.browserWindow.flashFrame(false);
|
||||
// appWindow.browserWindow.flashFrame(false);
|
||||
if (noti.type === NotificationType.Event) {
|
||||
appWindow.browserWindow.webContents.send(
|
||||
ChatChannel.OpenRoom,
|
||||
|
@ -820,13 +822,37 @@ ipcMain.on(
|
|||
if (!appWindow.isVisible()) {
|
||||
appWindow.browserWindow.minimize();
|
||||
}
|
||||
|
||||
// const img = nativeImage.createFromPath(
|
||||
// path.join(__dirname, 'assets/notification/images/img_nophoto_50.png')
|
||||
// );
|
||||
// console.log(img);
|
||||
// appWindow.browserWindow.setOverlayIcon(img, 'discription');
|
||||
// setTimeout(() => {
|
||||
// appWindow.browserWindow.setOverlayIcon(null, '');
|
||||
// }, 3000);
|
||||
appWindow.browserWindow.flashFrame(true);
|
||||
}
|
||||
);
|
||||
|
||||
ipcMain.on(
|
||||
NotificationChannel.CloseAllNotify,
|
||||
(event: IpcMainEvent, ...args: any[]) => {
|
||||
// appWindow.browserWindow.flashFrame(false);
|
||||
}
|
||||
);
|
||||
|
||||
ipcMain.on(
|
||||
WindowStateChannel.OnFlashFrame,
|
||||
(event: IpcMainEvent, ...args: any[]) => {
|
||||
appWindow.browserWindow.flashFrame(false);
|
||||
if (!appWindow.isVisible() && !appWindow.browserWindow.isMinimized()) {
|
||||
appWindow.browserWindow.minimize();
|
||||
}
|
||||
appWindow.browserWindow.flashFrame(true);
|
||||
}
|
||||
);
|
||||
ipcMain.on(
|
||||
WindowStateChannel.OffFlashFrame,
|
||||
(event: IpcMainEvent, ...args: any[]) => {
|
||||
appWindow.browserWindow.flashFrame(false);
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import { Component, OnInit, OnDestroy } from '@angular/core';
|
||||
import { Component, OnInit, OnDestroy, Inject } from '@angular/core';
|
||||
import { NGXLogger } from 'ngx-logger';
|
||||
import { ucapAnimations } from '@ucap-webmessenger/ui';
|
||||
import { Observable } from 'rxjs';
|
||||
|
@ -9,6 +9,8 @@ import * as MessageStore from '@app/store/messenger/message';
|
|||
import * as SettingsStore from '@app/store/messenger/settings';
|
||||
import { MatTabChangeEvent } from '@angular/material/tabs';
|
||||
import { MainMenu } from '@app/types';
|
||||
import { tap } from 'rxjs/operators';
|
||||
import { UCAP_NATIVE_SERVICE, NativeService } from '@ucap-webmessenger/native';
|
||||
|
||||
@Component({
|
||||
selector: 'app-layout-messenger-left-nav',
|
||||
|
@ -22,13 +24,34 @@ export class LeftNaviComponent implements OnInit, OnDestroy {
|
|||
badgeMessageInterval: any;
|
||||
|
||||
MainMenu = MainMenu;
|
||||
intervalFlashFrame: any;
|
||||
|
||||
constructor(private store: Store<any>, private logger: NGXLogger) {}
|
||||
constructor(
|
||||
private store: Store<any>,
|
||||
@Inject(UCAP_NATIVE_SERVICE) private nativeService: NativeService,
|
||||
private logger: NGXLogger
|
||||
) {}
|
||||
|
||||
ngOnInit() {
|
||||
/** About Chat Badge */
|
||||
this.badgeChatUnReadCount$ = this.store.pipe(
|
||||
select(AppStore.MessengerSelector.SyncSelector.selectChatUnreadCount)
|
||||
select(AppStore.MessengerSelector.SyncSelector.selectChatUnreadCount),
|
||||
tap(count => {
|
||||
// windows taskbar blinking unread count exist.
|
||||
if (!!count && count > 0) {
|
||||
if (!this.intervalFlashFrame) {
|
||||
this.intervalFlashFrame = setInterval(() => {
|
||||
this.nativeService.onFlashFlame();
|
||||
}, 1000);
|
||||
}
|
||||
} else {
|
||||
this.nativeService.offFlashFlame();
|
||||
if (!!this.intervalFlashFrame) {
|
||||
clearInterval(this.intervalFlashFrame);
|
||||
this.intervalFlashFrame = undefined;
|
||||
}
|
||||
}
|
||||
})
|
||||
);
|
||||
|
||||
/** About Message Badge */
|
||||
|
|
|
@ -380,7 +380,6 @@ export class MessagesComponent implements OnInit, OnDestroy, AfterViewInit {
|
|||
}
|
||||
});
|
||||
}
|
||||
console.log(this.offLineUsers);
|
||||
})
|
||||
)
|
||||
.subscribe();
|
||||
|
|
|
@ -213,6 +213,8 @@ export class BrowserNativeService extends NativeService {
|
|||
});
|
||||
}
|
||||
|
||||
onFlashFlame(): void {}
|
||||
offFlashFlame(): void {}
|
||||
windowStateChanged(): Observable<WindowState> {
|
||||
return new Observable<WindowState>(subscriber => {
|
||||
try {
|
||||
|
|
|
@ -352,6 +352,12 @@ export class ElectronNativeService implements NativeService {
|
|||
});
|
||||
}
|
||||
|
||||
onFlashFlame(): void {
|
||||
this.ipcRenderer.send(WindowStateChannel.OnFlashFrame);
|
||||
}
|
||||
offFlashFlame(): void {
|
||||
this.ipcRenderer.send(WindowStateChannel.OffFlashFrame);
|
||||
}
|
||||
windowStateChanged(): Observable<WindowState> {
|
||||
if (!this.windowStateChangedSubject) {
|
||||
this.windowStateChangedSubject = new Subject<WindowState>();
|
||||
|
|
|
@ -47,7 +47,9 @@ export enum ProcessChannel {
|
|||
|
||||
export enum WindowStateChannel {
|
||||
Changed = 'UCAP::windowState::windowStateChanged',
|
||||
FocuseChanged = 'UCAP::windowState::windowFocusStateChanged'
|
||||
FocuseChanged = 'UCAP::windowState::windowFocusStateChanged',
|
||||
OnFlashFrame = 'UCAP::windowState::OnFlashFrame',
|
||||
OffFlashFrame = 'UCAP::windowState::OffFlashFrame'
|
||||
}
|
||||
|
||||
export enum IdleStateChannel {
|
||||
|
|
|
@ -70,6 +70,8 @@ export abstract class NativeService {
|
|||
|
||||
abstract executeProcess(executableName: string): Promise<number>;
|
||||
|
||||
abstract onFlashFlame(): void;
|
||||
abstract offFlashFlame(): void;
|
||||
abstract windowStateChanged(): Observable<WindowState>;
|
||||
abstract windowClose(): void;
|
||||
abstract windowMinimize(): void;
|
||||
|
|
Loading…
Reference in New Issue
Block a user