From 9593b28a7b2c3aa4adb6ccca5d4d2d5bf0b95017 Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Mon, 30 Oct 2017 22:52:03 +0100 Subject: Recipe Notification API refactor Fixes: #104 --- src/webview/notifications.js | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/src/webview/notifications.js b/src/webview/notifications.js index b3397148d..4055b10de 100644 --- a/src/webview/notifications.js +++ b/src/webview/notifications.js @@ -1,47 +1,46 @@ const { ipcRenderer } = require('electron'); const uuidV1 = require('uuid/v1'); -// const FranzNotificationStore = []; class Notification { + static permission = 'granted'; + constructor(title = '', options = {}) { this.title = title; this.options = options; this.notificationId = uuidV1(); - this.onclick = () => { }; - ipcRenderer.sendToHost('notification', Notification.onNotify({ + ipcRenderer.sendToHost('notification', this.onNotify({ notificationId: this.notificationId, title, options, })); - ipcRenderer.on(`notification-onclick:${this.notificationId}`, () => { + ipcRenderer.once(`notification-onclick:${this.notificationId}`, () => { this.onclick(); }); } -} -Notification.permission = 'granted'; + static requestPermission(cb = null) { + if (!cb) { + return new Promise((resolve) => { + resolve(Notification.permission); + }); + } -Notification.requestPermission = (cb = null) => { - console.log(this); - if (!cb) { - return new Promise((resolve) => { - resolve(Notification.permission); - }); - } + if (typeof (cb) === 'function') { + return cb(Notification.permission); + } - if (typeof (cb) === 'function') { - return cb(Notification.permission); + return Notification.permission; } - return Notification.permission; -}; + onNotify(data) { + return data; + } -Notification.close = () => { - // no implementation yet -}; + onClick() {} -Notification.onNotify = data => data; + close() {} +} window.Notification = Notification; -- cgit v1.2.3-70-g09d2 From 11a23cfc46b801aedce7d389beaec3997cdf5a73 Mon Sep 17 00:00:00 2001 From: Stefan Date: Thu, 2 Nov 2017 23:10:34 +0100 Subject: Test window.show instead of restore --- src/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index 030736fee..361ad59db 100644 --- a/src/index.js +++ b/src/index.js @@ -32,7 +32,7 @@ if (isWindows) { if (process.platform !== 'darwin') { const isSecondInstance = app.makeSingleInstance(() => { if (mainWindow) { - if (mainWindow.isMinimized()) mainWindow.restore(); + if (mainWindow.isMinimized()) mainWindow.show(); mainWindow.focus(); } }); -- cgit v1.2.3-70-g09d2 From 8f8955024899c91d80681bbdd9ee3da35f42a518 Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Thu, 2 Nov 2017 23:52:21 +0100 Subject: Add download link Closes #202 --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 2a0d30f1e..6110573a8 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,9 @@ Messaging app for WhatsApp, Slack, Telegram, HipChat, Hangouts and many many more. +## [Download Franz](https://www.meetfranz.com) +👉 www.meetfranz.com + ## Development -- cgit v1.2.3-70-g09d2 From 28e993ee7cdf35019919d14b24408dd42979d8a7 Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Fri, 3 Nov 2017 00:15:43 +0100 Subject: Start from pinned icon --- package.json | 1 - src/index.js | 9 +++------ 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index dcb05bf6a..56c02ddf2 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,6 @@ "classnames": "^2.2.5", "electron-fetch": "^1.1.0", "electron-spellchecker": "^1.2.0", - "electron-squirrel-startup": "^1.0.0", "electron-updater": "^2.4.3", "electron-window-state": "^4.1.0", "fs-extra": "^3.0.1", diff --git a/src/index.js b/src/index.js index 361ad59db..a6c7e1d85 100644 --- a/src/index.js +++ b/src/index.js @@ -2,18 +2,14 @@ import { app, BrowserWindow, shell } from 'electron'; import fs from 'fs-extra'; import path from 'path'; -/* eslint-disable */ -if (require('electron-squirrel-startup')) app.quit(); - import windowStateKeeper from 'electron-window-state'; import { isDevMode, isWindows } from './environment'; import ipcApi from './electron/ipc-api'; import Tray from './lib/Tray'; import Settings from './electron/Settings'; -import { appId } from './package.json'; +import { appId } from './package.json'; // eslint-disable-line import/no-unresolved import './electron/exception'; -/* eslint-enable */ // Keep a global reference of the window object, if you don't, the window will // be closed automatically when the JavaScript object is garbage collected. @@ -32,9 +28,10 @@ if (isWindows) { if (process.platform !== 'darwin') { const isSecondInstance = app.makeSingleInstance(() => { if (mainWindow) { - if (mainWindow.isMinimized()) mainWindow.show(); + if (mainWindow.isMinimized()) mainWindow.restore(); mainWindow.focus(); } + return true; }); if (isSecondInstance) { -- cgit v1.2.3-70-g09d2 From 777814aa713e5093de52cb9c4c1cbf754b9e8289 Mon Sep 17 00:00:00 2001 From: Stefan Date: Fri, 3 Nov 2017 10:27:14 +0100 Subject: fix(Windows): Open Window when app is pinned to taskbar and minimized to system tray --- src/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/index.js b/src/index.js index a6c7e1d85..a72d76f3a 100644 --- a/src/index.js +++ b/src/index.js @@ -31,7 +31,6 @@ if (process.platform !== 'darwin') { if (mainWindow.isMinimized()) mainWindow.restore(); mainWindow.focus(); } - return true; }); if (isSecondInstance) { @@ -111,6 +110,13 @@ const createWindow = async () => { app.isMaximized = true; }); + mainWindow.on('close', (e) => { + if (settings.get('minimizeToSystemTray')) { + e.preventDefault(); + mainWindow.minimize(); + } + }); + mainWindow.on('unmaximize', () => { app.isMaximized = false; }); -- cgit v1.2.3-70-g09d2 From 34bba092fc7bfa828339d445385144535066b03b Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Fri, 3 Nov 2017 16:15:48 +0100 Subject: fix(macOS): Fix launch Franz on start override --- package.json | 1 + src/stores/AppStore.js | 67 ++++++++++++++++++-------------------------------- yarn.lock | 28 ++++++++++++++++----- 3 files changed, 47 insertions(+), 49 deletions(-) diff --git a/package.json b/package.json index 56c02ddf2..1c0aad789 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "license": "Apache-2.0", "dependencies": { "@paulcbetts/system-idle-time": "^1.0.4", + "auto-launch": "https://github.com/meetfranz/node-auto-launch.git", "babel-polyfill": "^6.23.0", "babel-runtime": "^6.23.0", "classnames": "^2.2.5", diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js index f608a689e..d8ef66a92 100644 --- a/src/stores/AppStore.js +++ b/src/stores/AppStore.js @@ -2,19 +2,23 @@ import { remote, ipcRenderer, shell } from 'electron'; import { action, observable } from 'mobx'; import moment from 'moment'; import key from 'keymaster'; -import path from 'path'; +// import path from 'path'; import idleTimer from '@paulcbetts/system-idle-time'; +import AutoLaunch from 'auto-launch'; import Store from './lib/Store'; import Request from './lib/Request'; import { CHECK_INTERVAL } from '../config'; -import { isMac, isLinux } from '../environment'; +import { isMac } from '../environment'; import locales from '../i18n/translations'; import { gaEvent } from '../lib/analytics'; import Miner from '../lib/Miner'; const { app, powerMonitor } = remote; const defaultLocale = 'en-US'; +const autoLauncher = new AutoLaunch({ + name: 'Franz', +}); export default class AppStore extends Store { updateStatusTypes = { @@ -41,7 +45,7 @@ export default class AppStore extends Store { miner = null; @observable minerHashrate = 0.0; - constructor(...args: any) { + constructor(...args) { super(...args); // Register action handlers @@ -157,28 +161,17 @@ export default class AppStore extends Store { ipcRenderer.send('updateAppIndicator', { indicator }); } - @action _launchOnStartup({ enable, openInBackground }) { + @action _launchOnStartup({ enable }) { this.autoLaunchOnStart = enable; - let settings = { - openAtLogin: enable, - }; - - // For Windows - if (process.platform === 'win32') { - settings = Object.assign({ - openAsHidden: openInBackground, - path: app.getPath('exe'), - args: [ - '--processStart', `"${path.basename(app.getPath('exe'))}"`, - ], - }, settings); - - if (openInBackground) { - settings.args.push( - '--process-start-args', '"--hidden"', - ); + try { + if (enable) { + autoLauncher.enable(); + } else { + autoLauncher.disable(); } + } catch (err) { + console.warn(err); } gaEvent('App', enable ? 'enable autostart' : 'disable autostart'); @@ -287,31 +280,19 @@ export default class AppStore extends Store { } async _autoStart() { - if (!isLinux) { - this._checkAutoStart(); - - // we need to wait until the settings request is resolved - await this.stores.settings.allSettingsRequest; + this.autoLaunchOnStart = await this._checkAutoStart(); - // We don't set autostart on first launch for macOS as disabling - // the option is currently broken - // https://github.com/meetfranz/franz/issues/17 - // https://github.com/electron/electron/issues/10880 - if (process.platform === 'darwin') return; + // we need to wait until the settings request is resolved + await this.stores.settings.allSettingsRequest; - if (!this.stores.settings.all.appStarts) { - this.actions.app.launchOnStartup({ - enable: true, - }); - } + if (!this.stores.settings.all.appStarts) { + this.actions.app.launchOnStartup({ + enable: true, + }); } } - _checkAutoStart() { - const loginItem = app.getLoginItemSettings({ - path: app.getPath('exe'), - }); - - this.autoLaunchOnStart = loginItem.openAtLogin; + async _checkAutoStart() { + return autoLauncher.isEnabled() || false; } } diff --git a/yarn.lock b/yarn.lock index a01368a4a..3bb344a2d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -151,6 +151,10 @@ anymatch@^1.3.0: micromatch "^2.1.5" normalize-path "^2.0.0" +applescript@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/applescript/-/applescript-1.0.0.tgz#bb87af568cad034a4e48c4bdaf6067a3a2701317" + aproba@^1.0.3: version "1.1.2" resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.1.2.tgz#45c6629094de4e96f693ef7eab74ae079c240fc1" @@ -319,6 +323,16 @@ asynckit@^0.4.0: version "0.4.0" resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79" +"auto-launch@https://github.com/meetfranz/node-auto-launch.git": + version "5.0.1" + resolved "https://github.com/meetfranz/node-auto-launch.git#b90a0470467eb84435e6554ae9db1e2c6db79e61" + dependencies: + applescript "^1.0.0" + mkdirp "^0.5.1" + path-is-absolute "^1.0.0" + untildify "^3.0.2" + winreg "1.2.2" + aws-sign2@~0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/aws-sign2/-/aws-sign2-0.6.0.tgz#14342dd38dbcc94d0e5b87d763cd63612c0e794f" @@ -1998,12 +2012,6 @@ electron-spellchecker@^1.2.0: rxjs-serial-subscription "^0.1.1" spawn-rx "^2.0.7" -electron-squirrel-startup@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/electron-squirrel-startup/-/electron-squirrel-startup-1.0.0.tgz#19b4e55933fa0ef8f556784b9c660f772546a0b8" - dependencies: - debug "^2.2.0" - electron-to-chromium@^1.3.18: version "1.3.20" resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.3.20.tgz#2eedd5ccbae7ddc557f68ad1fce9c172e915e4e5" @@ -5949,6 +5957,10 @@ universalify@^0.1.0: version "0.1.1" resolved "https://registry.yarnpkg.com/universalify/-/universalify-0.1.1.tgz#fa71badd4437af4c148841e3b3b165f9e9e590b7" +untildify@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/untildify/-/untildify-3.0.2.tgz#7f1f302055b3fea0f3e81dc78eb36766cb65e3f1" + unzip-response@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/unzip-response/-/unzip-response-2.0.1.tgz#d2f0f737d16b0615e72a6935ed04214572d56f97" @@ -6133,6 +6145,10 @@ window-size@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/window-size/-/window-size-0.1.4.tgz#f8e1aa1ee5a53ec5bf151ffa09742a6ad7697876" +winreg@1.2.2: + version "1.2.2" + resolved "https://registry.yarnpkg.com/winreg/-/winreg-1.2.2.tgz#8509afa3b71c5bbd110a6d7c6247ec67736c598f" + word-wrap@^1.0.3: version "1.2.3" resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" -- cgit v1.2.3-70-g09d2 From 7343d473cd44e8c5e800f39b9c6325053fbe5699 Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Fri, 3 Nov 2017 21:58:12 +0100 Subject: Reset linux shortcuts to Ctrl --- src/environment.js | 11 +---------- src/lib/Menu.js | 3 +-- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/environment.js b/src/environment.js index 7bb2db134..e185120c0 100644 --- a/src/environment.js +++ b/src/environment.js @@ -8,16 +8,7 @@ export const isMac = process.platform === 'darwin'; export const isWindows = process.platform === 'win32'; export const isLinux = process.platform === 'linux'; -let ctrlShortcutKey; -if (isMac) { - ctrlShortcutKey = '⌘'; -} else if (isWindows) { - ctrlShortcutKey = 'Ctrl'; -} else { - ctrlShortcutKey = 'Alt'; -} - -export const ctrlKey = ctrlShortcutKey; +export const ctrlKey = isMac ? '⌘' : 'Ctrl'; let api; if (!isDevMode || (isDevMode && useLiveAPI)) { diff --git a/src/lib/Menu.js b/src/lib/Menu.js index 6bbf302ca..9f62cc8c2 100644 --- a/src/lib/Menu.js +++ b/src/lib/Menu.js @@ -276,10 +276,9 @@ export default class FranzMenu { const services = this.stores.services.enabled; if (this.stores.user.isLoggedIn) { - const systemAcceleratorKey = isLinux ? 'Alt' : 'CmdOrCtrl'; return services.map((service, i) => ({ label: service.name, - accelerator: i <= 9 ? `${systemAcceleratorKey}+${i + 1}` : null, + accelerator: i <= 9 ? `CmdOrCtrl+${i + 1}` : null, type: 'radio', checked: service.isActive, click: () => { -- cgit v1.2.3-70-g09d2 From a54c87be1ce629cf13a5bfb9c2ba26958e0e4e74 Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Fri, 3 Nov 2017 23:22:38 +0100 Subject: Parse recipe author string --- package.json | 1 + src/models/Recipe.js | 16 ++++++++++++++-- yarn.lock | 10 ++++++++++ 3 files changed, 25 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 1c0aad789..fc0954e94 100644 --- a/package.json +++ b/package.json @@ -27,6 +27,7 @@ "license": "Apache-2.0", "dependencies": { "@paulcbetts/system-idle-time": "^1.0.4", + "address-rfc2822": "^2.0.1", "auto-launch": "https://github.com/meetfranz/node-auto-launch.git", "babel-polyfill": "^6.23.0", "babel-runtime": "^6.23.0", diff --git a/src/models/Recipe.js b/src/models/Recipe.js index 43a3450b1..4b613a40c 100644 --- a/src/models/Recipe.js +++ b/src/models/Recipe.js @@ -1,7 +1,8 @@ +import emailParser from 'address-rfc2822'; + export default class Recipe { id = ''; name = ''; - author = ''; description = ''; version = '1.0'; path = ''; @@ -30,7 +31,7 @@ export default class Recipe { this.id = data.id || this.id; this.name = data.name || this.name; - this.author = data.author || this.author; + this.rawAuthor = data.author || this.author; this.description = data.description || this.description; this.version = data.version || this.version; this.path = data.path; @@ -49,4 +50,15 @@ export default class Recipe { this.message = data.config.message || this.message; } + + get author() { + try { + const addresses = emailParser.parse(this.rawAuthor); + return addresses.map(a => ({ email: a.address, name: a.phrase })); + } catch (err) { + console.warn(`Not a valid author for ${this.name}`); + } + + return []; + } } diff --git a/yarn.lock b/yarn.lock index 3bb344a2d..0bedbac27 100644 --- a/yarn.lock +++ b/yarn.lock @@ -80,6 +80,12 @@ acorn@^5.1.1: version "5.1.2" resolved "https://registry.yarnpkg.com/acorn/-/acorn-5.1.2.tgz#911cb53e036807cf0fa778dc5d370fbd864246d7" +address-rfc2822@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/address-rfc2822/-/address-rfc2822-2.0.1.tgz#1a1bdb942b5e20e2c1ba5d5f396d5824ff7ae6ea" + dependencies: + email-addresses "^3.0.0" + after@0.8.2: version "0.8.2" resolved "https://registry.yarnpkg.com/after/-/after-0.8.2.tgz#fedb394f9f0e02aa9768e702bda23b505fae7e1f" @@ -2049,6 +2055,10 @@ electron@^1.7.9: electron-download "^3.0.1" extract-zip "^1.0.3" +email-addresses@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/email-addresses/-/email-addresses-3.0.1.tgz#c1fc20c189e7f96d4012d375db5feaccdd24391c" + emojis-list@^2.0.0: version "2.1.0" resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" -- cgit v1.2.3-70-g09d2 From 7a9947a08e6acd922787d866ba2ba6fc5a779f82 Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Fri, 3 Nov 2017 23:24:36 +0100 Subject: feat(Recipes): Recipe developers don't need Premium Supporter Account for debugging Closes #23 --- src/components/settings/services/EditServiceForm.js | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/components/settings/services/EditServiceForm.js b/src/components/settings/services/EditServiceForm.js index fac0f6b9a..9b359a78e 100644 --- a/src/components/settings/services/EditServiceForm.js +++ b/src/components/settings/services/EditServiceForm.js @@ -69,10 +69,6 @@ const messages = defineMessages({ export default class EditServiceForm extends Component { static propTypes = { recipe: PropTypes.instanceOf(Recipe).isRequired, - // service: PropTypes.oneOfType([ - // PropTypes.object, - // PropTypes.instanceOf(Service), - // ]), service(props, propName) { if (props.action === 'edit' && !(props[propName] instanceof Service)) { return new Error(`'${propName}'' is expected to be of type 'Service' @@ -207,7 +203,7 @@ export default class EditServiceForm extends Component { )} {recipe.hasCustomUrl && ( - {user.isPremium ? ( + {user.isPremium || recipe.author.find(a => a.email === user.email) ? (
{form.error === 'url-validation-error' && ( -- cgit v1.2.3-70-g09d2 From 71c2d4ecca28ad326ae94578acdfae12742786e3 Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Fri, 3 Nov 2017 23:53:43 +0100 Subject: fix eslint issue --- src/lib/Menu.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/Menu.js b/src/lib/Menu.js index 9f62cc8c2..8f0a92c3d 100644 --- a/src/lib/Menu.js +++ b/src/lib/Menu.js @@ -1,7 +1,7 @@ import { remote, shell } from 'electron'; import { autorun, computed, observable, toJS } from 'mobx'; -import { isMac, isLinux } from '../environment'; +import { isMac } from '../environment'; const { app, Menu, dialog } = remote; -- cgit v1.2.3-70-g09d2 From 2e894d6d53a952bfae74f5b6b19040e505765416 Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Fri, 3 Nov 2017 23:59:23 +0100 Subject: fix(App): Add checks to service url validation to prevent app freeze --- src/models/Service.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/models/Service.js b/src/models/Service.js index 7a0310ebc..484252e7c 100644 --- a/src/models/Service.js +++ b/src/models/Service.js @@ -58,7 +58,12 @@ export default class Service { @computed get url() { if (this.recipe.hasCustomUrl && this.customUrl) { - let url = normalizeUrl(this.customUrl); + let url; + try { + url = normalizeUrl(this.customUrl); + } catch (err) { + console.error(`Service (${this.recipe.name}): '${this.customUrl}' is not a valid Url.`); + } if (typeof this.recipe.buildUrl === 'function') { url = this.recipe.buildUrl(url); -- cgit v1.2.3-70-g09d2 From def4b27e980da4e32f494c6832c1851e3364a252 Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Sat, 4 Nov 2017 00:11:41 +0100 Subject: Improve (dev) recipe loading --- src/api/server/ServerApi.js | 17 ++++++++++++----- src/models/Recipe.js | 3 ++- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/api/server/ServerApi.js b/src/api/server/ServerApi.js index 8b0b7563c..932b70cdc 100644 --- a/src/api/server/ServerApi.js +++ b/src/api/server/ServerApi.js @@ -499,7 +499,7 @@ export default class ServerApi { return recipe; }), - ).catch(err => console.error(err)); + ).catch(err => console.error('Can\'t load recipe', err)); } _mapRecipePreviewModel(recipes) { @@ -562,9 +562,16 @@ export default class ServerApi { .filter(file => fs.statSync(path.join(recipesDirectory, file)).isDirectory() && file !== 'temp'); const recipes = paths.map((id) => { - // eslint-disable-next-line - const Recipe = require(id)(RecipeModel); - return new Recipe(loadRecipeConfig(id)); + let Recipe; + try { + // eslint-disable-next-line + Recipe = require(id)(RecipeModel); + return new Recipe(loadRecipeConfig(id)); + } catch (err) { + console.error(err); + } + + return false; }).filter(recipe => recipe.id).map((data) => { const recipe = data; @@ -579,7 +586,7 @@ export default class ServerApi { return recipes; } catch (err) { - console.debug('Folder `recipe/dev` does not exist'); + console.debug('Could not load dev recipes'); return false; } } diff --git a/src/models/Recipe.js b/src/models/Recipe.js index 4b613a40c..9971df77c 100644 --- a/src/models/Recipe.js +++ b/src/models/Recipe.js @@ -26,7 +26,8 @@ export default class Recipe { } if (!data.id) { - throw Error('Recipe requires Id'); + // Franz 4 recipes do not have an Id + throw Error(`Recipe '${data.name}' requires Id`); } this.id = data.id || this.id; -- cgit v1.2.3-70-g09d2 From 6c32d1ab4a89105cfaae221eeac354efefdbe72c Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Sat, 4 Nov 2017 00:28:41 +0100 Subject: Clean recipe temp dir on start --- src/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/index.js b/src/index.js index a72d76f3a..a3aa14732 100644 --- a/src/index.js +++ b/src/index.js @@ -18,6 +18,7 @@ let willQuitApp = false; // Ensure that the recipe directory exists fs.ensureDir(path.join(app.getPath('userData'), 'recipes')); +fs.emptyDirSync(path.join(app.getPath('userData'), 'recipes', 'temp')); // Set App ID for Windows if (isWindows) { -- cgit v1.2.3-70-g09d2 From 29e26bab8e9e8ce637c87dd0a33e392233fc3aa7 Mon Sep 17 00:00:00 2001 From: Stefan Date: Sat, 4 Nov 2017 20:24:19 +0100 Subject: Test perMachine: false --- electron-builder.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/electron-builder.yml b/electron-builder.yml index 0a01a03d8..3f7ad1e85 100644 --- a/electron-builder.yml +++ b/electron-builder.yml @@ -29,5 +29,5 @@ linux: - target: deb nsis: - perMachine: true + perMachine: false oneClick: true -- cgit v1.2.3-70-g09d2 From 22fc742ed6d719372e591975a61669a96ba90407 Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Sat, 4 Nov 2017 22:18:44 +0100 Subject: Make sure that numeric bages are ints --- src/stores/AppStore.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/stores/AppStore.js b/src/stores/AppStore.js index d8ef66a92..ecfd621d3 100644 --- a/src/stores/AppStore.js +++ b/src/stores/AppStore.js @@ -156,6 +156,8 @@ export default class AppStore extends Store { indicator = '•'; } else if (unreadDirectMessageCount === 0 && unreadIndirectMessageCount === 0) { indicator = 0; + } else { + indicator = parseInt(indicator, 10); } ipcRenderer.send('updateAppIndicator', { indicator }); -- cgit v1.2.3-70-g09d2 From 067d858188ffba8b85ae7cc8cf1eaec970d739d2 Mon Sep 17 00:00:00 2001 From: Alessandro Roncone Date: Sat, 4 Nov 2017 19:37:54 -0400 Subject: Added sentence to redirect plugin requests to the form --- .github/ISSUE_TEMPLATE.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 4ef48f240..c11a2994f 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -1,5 +1,7 @@ + + ### Expected Behavior -- cgit v1.2.3-70-g09d2 From 21e4886b418e7064dc43d15fd39ca0109d039743 Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Sun, 5 Nov 2017 21:05:31 +0100 Subject: bump version to beta 12 --- CHANGELOG.md | 22 ++++++++++++++++++++++ package.json | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e6551ed51..5b5a0755c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,25 @@ + +# [5.0.0-beta.12](https://github.com/meetfranz/franz/compare/v5.0.0-beta.11...v5.0.0-beta.12) (2017-11-05) + +### Features + +* **Menu:** Add "About Franz" Menu item to Windows/Linux ([a21b770](https://github.com/meetfranz/franz/commit/a21b770)) +* **Menu:** Add menu item to toggle (service) dev tools ([e8da383](https://github.com/meetfranz/franz/commit/e8da383)) +* **Translation:** Add italian translation ([ab348cc](https://github.com/meetfranz/franz/commit/ab348cc)) ([dnlup](https://github.com/dnlup)) + + +### Bug Fixes + +* **App:** Add checks to service url validation to prevent app freeze ([db8515f](https://github.com/meetfranz/franz/commit/db8515f)) +* **macOS:** Fix disable launch Franz on start ([34bba09](https://github.com/meetfranz/franz/commit/34bba09)) +* **Windows:** Launch Franz on start when selected ([34bba09](https://github.com/meetfranz/franz/commit/34bba09)) +* **Onboarding:** Fix issue with import of on-premise services ([7c7d27d](https://github.com/meetfranz/franz/commit/7c7d27d)) +* **Shortcuts:** Flip shortcut to navigate to next/previous service ([37d5923](https://github.com/meetfranz/franz/commit/37d5923)) +* **Windows:** Open Window when app is pinned to taskbar and minimized to system tray ([777814a](https://github.com/meetfranz/franz/commit/777814a)) +* **Recipes:** Recipe developers don't need Premium Supporter Account for debugging ([7a9947a](https://github.com/meetfranz/franz/commit/7a9947a)), closes [#23](https://github.com/meetfranz/franz/issues/23) + + + # [5.0.0-beta.11](https://github.com/meetfranz/franz/compare/v5.0.0-beta.10...v5.0.0-beta.11) (2017-10-24) diff --git a/package.json b/package.json index fc0954e94..057dc6d60 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "franz", "productName": "Franz", "appId": "com.meetfranz.franz", - "version": "5.0.0-beta.11", + "version": "5.0.0-beta.12", "description": "Messaging app for WhatsApp, Slack, Telegram, HipChat, Hangouts and many many more.", "copyright": "adlk x franz - Stefan Malzner", "main": "index.js", -- cgit v1.2.3-70-g09d2 From c95d6f3d7ad5cf7f46a6fba11f6e57a2b46bc452 Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Mon, 6 Nov 2017 14:04:57 +0100 Subject: add debugging output for mainWindow --- src/index.js | 25 ++++++++++++++----------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/src/index.js b/src/index.js index a3aa14732..4507913ad 100644 --- a/src/index.js +++ b/src/index.js @@ -26,19 +26,22 @@ if (isWindows) { } // Force single window -if (process.platform !== 'darwin') { - const isSecondInstance = app.makeSingleInstance(() => { - if (mainWindow) { - if (mainWindow.isMinimized()) mainWindow.restore(); - mainWindow.focus(); - } - }); - - if (isSecondInstance) { - app.quit(); +// if (process.platform !== 'darwin') { +const isSecondInstance = app.makeSingleInstance(() => { + console.log(mainWindow); + console.log('isMinimized', mainWindow.isMinimized); + if (mainWindow) { + if (mainWindow.isMinimized()) mainWindow.restore(); + mainWindow.focus(); } +}); + +if (isSecondInstance) { + app.exit(); } +// } + // Initialize Settings const settings = new Settings(); @@ -112,7 +115,7 @@ const createWindow = async () => { }); mainWindow.on('close', (e) => { - if (settings.get('minimizeToSystemTray')) { + if (settings.get('minimizeToSystemTray') && settings.get('runInBackground')) { e.preventDefault(); mainWindow.minimize(); } -- cgit v1.2.3-70-g09d2 From eea593eaab81ec311f86204d60623fe8f68b13ed Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Mon, 6 Nov 2017 14:47:05 +0100 Subject: fix multiple on close handler --- src/index.js | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/index.js b/src/index.js index 4507913ad..3b86f09bc 100644 --- a/src/index.js +++ b/src/index.js @@ -26,7 +26,6 @@ if (isWindows) { } // Force single window -// if (process.platform !== 'darwin') { const isSecondInstance = app.makeSingleInstance(() => { console.log(mainWindow); console.log('isMinimized', mainWindow.isMinimized); @@ -40,7 +39,6 @@ if (isSecondInstance) { app.exit(); } -// } // Initialize Settings const settings = new Settings(); @@ -89,9 +87,13 @@ const createWindow = async () => { // when you should delete the corresponding element. if (!willQuitApp && (settings.get('runInBackground') === undefined || settings.get('runInBackground'))) { e.preventDefault(); - mainWindow.hide(); + if (isWindows) { + mainWindow.minimize(); + } else { + mainWindow.hide(); + } - if (process.platform === 'win32') { + if (isWindows && settings.get('minimizeToSystemTray')) { mainWindow.setSkipTaskbar(true); } } else { @@ -114,13 +116,6 @@ const createWindow = async () => { app.isMaximized = true; }); - mainWindow.on('close', (e) => { - if (settings.get('minimizeToSystemTray') && settings.get('runInBackground')) { - e.preventDefault(); - mainWindow.minimize(); - } - }); - mainWindow.on('unmaximize', () => { app.isMaximized = false; }); -- cgit v1.2.3-70-g09d2 From 9d8742faa465f51d61e0ab8b132ca12e2f53ae26 Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Mon, 6 Nov 2017 15:15:33 +0100 Subject: remove debugging --- src/index.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/index.js b/src/index.js index 3b86f09bc..f0fe56ae5 100644 --- a/src/index.js +++ b/src/index.js @@ -27,8 +27,6 @@ if (isWindows) { // Force single window const isSecondInstance = app.makeSingleInstance(() => { - console.log(mainWindow); - console.log('isMinimized', mainWindow.isMinimized); if (mainWindow) { if (mainWindow.isMinimized()) mainWindow.restore(); mainWindow.focus(); -- cgit v1.2.3-70-g09d2 From 08c45d3e07b06c7ae4f2635d312edeb1b7a2bc8e Mon Sep 17 00:00:00 2001 From: Stefan Malzner Date: Mon, 6 Nov 2017 16:00:47 +0100 Subject: Bump version to beta 13 --- CHANGELOG.md | 8 ++++++++ package.json | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5b5a0755c..024afe93c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ + +# [5.0.0-beta.13](https://github.com/meetfranz/franz/compare/v5.0.0-beta.12...v5.0.0-beta.13) (2017-11-06) + +### Bug Fixes + +* **Windows:** Fix issue with multiple close handlers that prevent the app from quitting ([eea593e](https://github.com/meetfranz/franz/commit/eea593e)) + + # [5.0.0-beta.12](https://github.com/meetfranz/franz/compare/v5.0.0-beta.11...v5.0.0-beta.12) (2017-11-05) diff --git a/package.json b/package.json index 057dc6d60..9b56cdf27 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "franz", "productName": "Franz", "appId": "com.meetfranz.franz", - "version": "5.0.0-beta.12", + "version": "5.0.0-beta.13", "description": "Messaging app for WhatsApp, Slack, Telegram, HipChat, Hangouts and many many more.", "copyright": "adlk x franz - Stefan Malzner", "main": "index.js", -- cgit v1.2.3-70-g09d2 From 811a52718c7a98f0e8d2fe2069f1ecba3d407564 Mon Sep 17 00:00:00 2001 From: Danny Qiu Date: Mon, 6 Nov 2017 11:53:54 -0500 Subject: Prevent app from redirecting when dropping link --- src/app.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/app.js b/src/app.js index b539ea494..a0b88611c 100644 --- a/src/app.js +++ b/src/app.js @@ -101,3 +101,7 @@ window.addEventListener('load', () => { }; window.franz.render(); }); + +// Prevent drag and drop into window from redirecting +window.addEventListener('dragover', event => event.preventDefault()); +window.addEventListener('drop', event => event.preventDefault()); -- cgit v1.2.3-70-g09d2