Ver código fonte

通知窗口点击按钮后关闭窗体

main
郑州 3 anos atrás
pai
commit
656b566af6
1 arquivos alterados com 9 adições e 2 exclusões
  1. +9
    -2
      electron/notifycation.html

+ 9
- 2
electron/notifycation.html Ver arquivo

@@ -254,25 +254,32 @@
syncResult.classList.add('hide'); syncResult.classList.add('hide');
syncIncoming.classList.add('hide'); syncIncoming.classList.add('hide');


closeBtn.addEventListener('click', function () { window.ipcRenderer.invoke('window:hide'); });
function closeWindow() {
window.ipcRenderer.invoke('window:hide');
}
closeBtn.addEventListener('click', closeWindow);


syncMsgBtn.addEventListener('click', function () { syncMsgBtn.addEventListener('click', function () {
if (contextMsg.taskSyncStatus === 'TASK_SYNC_STATUS_FINISH') { // 查看 if (contextMsg.taskSyncStatus === 'TASK_SYNC_STATUS_FINISH') { // 查看
window.ipcRenderer.invoke('open-file-position', contextMsg); window.ipcRenderer.invoke('open-file-position', contextMsg);
closeWindow();
return; return;
} }
if (contextMsg.taskSyncStatus === 'TASK_SYNC_STATUS_FAIL') { // 重新同步 if (contextMsg.taskSyncStatus === 'TASK_SYNC_STATUS_FAIL') { // 重新同步
window.ipcRenderer.invoke('re-sync-file', contextMsg); window.ipcRenderer.invoke('re-sync-file', contextMsg);
closeWindow();
return; return;
} }
if (contextMsg.notifyType === 1) { // 下载 if (contextMsg.notifyType === 1) { // 下载
window.ipcRenderer.invoke('download-file', contextMsg); window.ipcRenderer.invoke('download-file', contextMsg);
closeWindow();
return; return;
} }
}); });


conflictMsgBtn.addEventListener('click', function () {
conflictMsgBtn.addEventListener('click', function () { // 下载
window.ipcRenderer.invoke('download-file', contextMsg); window.ipcRenderer.invoke('download-file', contextMsg);
closeWindow();
}); });


window.addIpcRendererListener('on-notify', function (_, message) { // message: DATA.SocketFileMsg window.addIpcRendererListener('on-notify', function (_, message) { // message: DATA.SocketFileMsg


Carregando…
Cancelar
Salvar