fix(cal): remove calendar from protcols

Test Plan: manual

Reviewers: halla, juan

Reviewed By: juan

Differential Revision: https://phab.nylas.com/D3685
This commit is contained in:
Evan Morikawa 2017-01-14 17:28:08 -08:00
parent d60226f0c6
commit 6c2e964416
5 changed files with 20 additions and 23 deletions

View file

@ -248,9 +248,6 @@ module.exports = (grunt) => {
// left in the Electron Info.plist file // left in the Electron Info.plist file
'extend-info': path.resolve(grunt.config('appDir'), 'build', 'resources', 'mac', 'nylas-Info.plist'), 'extend-info': path.resolve(grunt.config('appDir'), 'build', 'resources', 'mac', 'nylas-Info.plist'),
'app-bundle-id': "com.nylas.nylas-mail", 'app-bundle-id': "com.nylas.nylas-mail",
'extra-resource': [
path.resolve(grunt.config('appDir'), 'build', 'resources', 'mac', 'Nylas Calendar.app'),
],
'afterCopy': [ 'afterCopy': [
runCopyPlatformSpecificResources, runCopyPlatformSpecificResources,
runCopyAPM, runCopyAPM,

2
src/K2

@ -1 +1 @@
Subproject commit cedec79b0136d5025b99c053bb40d899958f581e Subproject commit 8812ff63b080c20a59e01b171b04ea823b36d129

View file

@ -705,9 +705,9 @@ export default class Application extends EventEmitter {
if (parts.protocol === 'mailto:') { if (parts.protocol === 'mailto:') {
main.sendMessage('mailto', urlToOpen); main.sendMessage('mailto', urlToOpen);
} else if (parts.protocol === 'nylas:') { } else if (parts.protocol === 'nylas:') {
if (parts.host === 'calendar') { // if (parts.host === 'calendar') {
this.openCalendarURL(parts.path); // this.openCalendarURL(parts.path);
} else if (parts.host === 'plugins') { if (parts.host === 'plugins') {
main.sendMessage('changePluginStateFromUrl', urlToOpen); main.sendMessage('changePluginStateFromUrl', urlToOpen);
} else { } else {
main.sendMessage('openExternalThread', urlToOpen); main.sendMessage('openExternalThread', urlToOpen);
@ -717,19 +717,19 @@ export default class Application extends EventEmitter {
} }
} }
openCalendarURL(command) { // openCalendarURL(command) {
if (command === '/open') { // if (command === '/open') {
this.windowManager.ensureWindow(WindowManager.CALENDAR_WINDOW, { // this.windowManager.ensureWindow(WindowManager.CALENDAR_WINDOW, {
windowKey: WindowManager.CALENDAR_WINDOW, // windowKey: WindowManager.CALENDAR_WINDOW,
windowType: WindowManager.CALENDAR_WINDOW, // windowType: WindowManager.CALENDAR_WINDOW,
title: "Calendar", // title: "Calendar",
hidden: false, // hidden: false,
}); // });
} else if (command === '/close') { // } else if (command === '/close') {
const win = this.windowManager.get(WindowManager.CALENDAR_WINDOW); // const win = this.windowManager.get(WindowManager.CALENDAR_WINDOW);
if (win) { win.hide(); } // if (win) { win.hide(); }
} // }
} // }
openComposerWithFiles(pathsToOpen) { openComposerWithFiles(pathsToOpen) {
const main = this.windowManager.get(WindowManager.MAIN_WINDOW); const main = this.windowManager.get(WindowManager.MAIN_WINDOW);

View file

@ -6,7 +6,7 @@ const MAIN_WINDOW = "default"
const WORK_WINDOW = "work" const WORK_WINDOW = "work"
const SPEC_WINDOW = "spec" const SPEC_WINDOW = "spec"
const ONBOARDING_WINDOW = "onboarding" const ONBOARDING_WINDOW = "onboarding"
const CALENDAR_WINDOW = "calendar" // const CALENDAR_WINDOW = "calendar"
export default class WindowManager { export default class WindowManager {
@ -239,5 +239,5 @@ export default class WindowManager {
WindowManager.MAIN_WINDOW = MAIN_WINDOW; WindowManager.MAIN_WINDOW = MAIN_WINDOW;
WindowManager.WORK_WINDOW = WORK_WINDOW; WindowManager.WORK_WINDOW = WORK_WINDOW;
WindowManager.SPEC_WINDOW = SPEC_WINDOW; WindowManager.SPEC_WINDOW = SPEC_WINDOW;
WindowManager.CALENDAR_WINDOW = CALENDAR_WINDOW; // WindowManager.CALENDAR_WINDOW = CALENDAR_WINDOW;
WindowManager.ONBOARDING_WINDOW = ONBOARDING_WINDOW; WindowManager.ONBOARDING_WINDOW = ONBOARDING_WINDOW;

View file

@ -163,7 +163,7 @@ class WindowEventHandler
{protocol} = url.parse(href) {protocol} = url.parse(href)
return unless protocol 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. # 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 # (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. # *might* apply to http/https as well but it's unclear.