From fefe0c1b9718f81bf7dc0a9451ec3059c99ffee3 Mon Sep 17 00:00:00 2001 From: Anthony Tseng Date: Fri, 23 Sep 2016 02:15:32 +0800 Subject: [PATCH] change import dialog switch default from OFF to ON for available data types fix #4187 Auditors: @bbondy Test Plan: 1. Click "Import browser data..." 2. Choose between browsers 3. Support options should be on --- .../components/importBrowserDataPanel.js | 32 +++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) diff --git a/app/renderer/components/importBrowserDataPanel.js b/app/renderer/components/importBrowserDataPanel.js index 09042743e77..71bb84305df 100644 --- a/app/renderer/components/importBrowserDataPanel.js +++ b/app/renderer/components/importBrowserDataPanel.js @@ -69,11 +69,39 @@ class ImportBrowserDataPanel extends ImmutableComponent { this.props.onHide() } onChange (e) { - windowActions.setImportBrowserDataSelected( - this.props.importBrowserDataSelected.set('index', e.target.value)) + this.props.importBrowserDataSelected = this.props.importBrowserDataSelected.set('index', e.target.value) + this.props.importBrowserDataSelected = this.props.importBrowserDataSelected.set('history', false) + this.props.importBrowserDataSelected = this.props.importBrowserDataSelected.set('favorites', false) + this.props.importBrowserDataSelected = this.props.importBrowserDataSelected.set('mergeFavorites', false) + this.props.importBrowserDataSelected = this.props.importBrowserDataSelected.set('cookies', false) + let importBrowserDataSelected = this.props.importBrowserDataSelected + if (this.supportHistory) { + importBrowserDataSelected = importBrowserDataSelected.set('history', true) + } + if (this.supportFavorites) { + importBrowserDataSelected = importBrowserDataSelected.set('favorites', true) + importBrowserDataSelected = importBrowserDataSelected.set('mergeFavorites', true) + } + if (this.supportCookies) { + importBrowserDataSelected = importBrowserDataSelected.set('cookies', true) + } + windowActions.setImportBrowserDataSelected(importBrowserDataSelected) } get selectedBrowser () { let index = this.props.importBrowserDataSelected.get('index') + if (index === undefined) { + this.props.importBrowserDataSelected = this.props.importBrowserDataSelected.set('index', '0') + if (this.supportHistory) { + this.props.importBrowserDataSelected = this.props.importBrowserDataSelected.set('history', true) + } + if (this.supportFavorites) { + this.props.importBrowserDataSelected = this.props.importBrowserDataSelected.set('favorites', true) + this.props.importBrowserDataSelected = this.props.importBrowserDataSelected.set('mergeFavorites', true) + } + if (this.supportCookies) { + this.props.importBrowserDataSelected = this.props.importBrowserDataSelected.set('cookies', true) + } + } return index !== undefined ? index : '0' } render () {