From 6c2e964416f9f89256b710d457c06656f2437f2a Mon Sep 17 00:00:00 2001 From: Evan Morikawa Date: Sat, 14 Jan 2017 17:28:08 -0800 Subject: [PATCH] fix(cal): remove calendar from protcols Test Plan: manual Reviewers: halla, juan Reviewed By: juan Differential Revision: https://phab.nylas.com/D3685 --- build/tasks/package-task.js | 3 --- src/K2 | 2 +- src/browser/application.es6 | 32 ++++++++++++++++---------------- src/browser/window-manager.es6 | 4 ++-- src/window-event-handler.coffee | 2 +- 5 files changed, 20 insertions(+), 23 deletions(-) diff --git a/build/tasks/package-task.js b/build/tasks/package-task.js index 371301de2..96c7d90aa 100644 --- a/build/tasks/package-task.js +++ b/build/tasks/package-task.js @@ -248,9 +248,6 @@ module.exports = (grunt) => { // left in the Electron Info.plist file 'extend-info': path.resolve(grunt.config('appDir'), 'build', 'resources', 'mac', 'nylas-Info.plist'), 'app-bundle-id': "com.nylas.nylas-mail", - 'extra-resource': [ - path.resolve(grunt.config('appDir'), 'build', 'resources', 'mac', 'Nylas Calendar.app'), - ], 'afterCopy': [ runCopyPlatformSpecificResources, runCopyAPM, diff --git a/src/K2 b/src/K2 index cedec79b0..8812ff63b 160000 --- a/src/K2 +++ b/src/K2 @@ -1 +1 @@ -Subproject commit cedec79b0136d5025b99c053bb40d899958f581e +Subproject commit 8812ff63b080c20a59e01b171b04ea823b36d129 diff --git a/src/browser/application.es6 b/src/browser/application.es6 index 1715f5cca..5cf86b60a 100644 --- a/src/browser/application.es6 +++ b/src/browser/application.es6 @@ -705,9 +705,9 @@ export default class Application extends EventEmitter { if (parts.protocol === 'mailto:') { main.sendMessage('mailto', urlToOpen); } else if (parts.protocol === 'nylas:') { - if (parts.host === 'calendar') { - this.openCalendarURL(parts.path); - } else if (parts.host === 'plugins') { + // if (parts.host === 'calendar') { + // this.openCalendarURL(parts.path); + if (parts.host === 'plugins') { main.sendMessage('changePluginStateFromUrl', urlToOpen); } else { main.sendMessage('openExternalThread', urlToOpen); @@ -717,19 +717,19 @@ export default class Application extends EventEmitter { } } - openCalendarURL(command) { - if (command === '/open') { - this.windowManager.ensureWindow(WindowManager.CALENDAR_WINDOW, { - windowKey: WindowManager.CALENDAR_WINDOW, - windowType: WindowManager.CALENDAR_WINDOW, - title: "Calendar", - hidden: false, - }); - } else if (command === '/close') { - const win = this.windowManager.get(WindowManager.CALENDAR_WINDOW); - if (win) { win.hide(); } - } - } + // openCalendarURL(command) { + // if (command === '/open') { + // this.windowManager.ensureWindow(WindowManager.CALENDAR_WINDOW, { + // windowKey: WindowManager.CALENDAR_WINDOW, + // windowType: WindowManager.CALENDAR_WINDOW, + // title: "Calendar", + // hidden: false, + // }); + // } else if (command === '/close') { + // const win = this.windowManager.get(WindowManager.CALENDAR_WINDOW); + // if (win) { win.hide(); } + // } + // } openComposerWithFiles(pathsToOpen) { const main = this.windowManager.get(WindowManager.MAIN_WINDOW); diff --git a/src/browser/window-manager.es6 b/src/browser/window-manager.es6 index 20e66a221..1939e5d6c 100644 --- a/src/browser/window-manager.es6 +++ b/src/browser/window-manager.es6 @@ -6,7 +6,7 @@ const MAIN_WINDOW = "default" const WORK_WINDOW = "work" const SPEC_WINDOW = "spec" const ONBOARDING_WINDOW = "onboarding" -const CALENDAR_WINDOW = "calendar" +// const CALENDAR_WINDOW = "calendar" export default class WindowManager { @@ -239,5 +239,5 @@ export default class WindowManager { WindowManager.MAIN_WINDOW = MAIN_WINDOW; WindowManager.WORK_WINDOW = WORK_WINDOW; WindowManager.SPEC_WINDOW = SPEC_WINDOW; -WindowManager.CALENDAR_WINDOW = CALENDAR_WINDOW; +// WindowManager.CALENDAR_WINDOW = CALENDAR_WINDOW; WindowManager.ONBOARDING_WINDOW = ONBOARDING_WINDOW; diff --git a/src/window-event-handler.coffee b/src/window-event-handler.coffee index cceb5a798..cf866f1be 100644 --- a/src/window-event-handler.coffee +++ b/src/window-event-handler.coffee @@ -163,7 +163,7 @@ class WindowEventHandler {protocol} = url.parse(href) return unless protocol - if protocol in ['mailto:', 'calendar:', 'nylas:'] + if protocol in ['mailto:', 'nylas:'] # We sometimes get mailto URIs that are not escaped properly, or have been only partially escaped. # (T1927) Be sure to escape them once, and completely, before we try to open them. This logic # *might* apply to http/https as well but it's unclear.