Skip to content

Commit 545c7a1

Browse files
committed
remove sync this device option
closes brave/brave-browser#2156
1 parent 246c75d commit 545c7a1

File tree

10 files changed

+1
-57
lines changed

10 files changed

+1
-57
lines changed

browser/ui/webui/brave_webui_source.cc

-1
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,6 @@ void CustomizeWebUIHTMLSource(const std::string &name, content::WebUIDataSource*
421421
{ "beta", IDS_BRAVE_SYNC_TITLE_BETA },
422422
{ "syncInfo1", IDS_BRAVE_SYNC_INFO_1 },
423423
{ "syncInfo2", IDS_BRAVE_SYNC_INFO_2 },
424-
{ "syncThisDevice", IDS_BRAVE_SYNC_DEVICE_SYNC },
425424
{ "done", IDS_BRAVE_SYNC_DONE },
426425
{ "cancel", IDS_BRAVE_SYNC_CANCEL },
427426
{ "areYouSure", IDS_BRAVE_SYNC_ARE_YOU_SURE },

components/brave_sync/ui/actions/sync_actions.ts

-8
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,6 @@ export const onSyncReset = () => {
8383
return action(types.SYNC_ON_RESET)
8484
}
8585

86-
/**
87-
* Dispatches a message telling the back-end whether or not this device should be synced
88-
* @param {boolean} shouldSyncThisDevice - Whether or not it should keep syncing the current device
89-
*/
90-
export const onToggleSyncThisDevice = (shouldSyncThisDevice: boolean) => {
91-
return action(types.SYNC_ON_SYNC_THIS_DEVICE, { shouldSyncThisDevice })
92-
}
93-
9486
/**
9587
* Dispatches a message telling the back-end that user toggled the bookmarks sync
9688
* @param {boolean} shouldEnable - Whether or not it should sync the bookmarks

components/brave_sync/ui/components/enabledContent.tsx

+1-24
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,14 @@
55
import * as React from 'react'
66

77
// Components
8-
import { Card, Button } from 'brave-ui'
8+
import { Button } from 'brave-ui'
99
import SwitchButton from 'brave-ui/old/switchButton'
1010
import Table, { Cell, Row } from 'brave-ui/components/dataTables/table'
1111

1212
// Feature-specific components
1313
import {
1414
Grid,
15-
FlexColumn,
1615
SwitchLabel,
17-
Label,
1816
Paragraph,
1917
SectionBlock,
2018
SubTitle
@@ -102,10 +100,6 @@ class SyncEnabledContent extends React.PureComponent<SyncEnabledContentProps, Sy
102100
this.props.actions.onSyncReset()
103101
}
104102

105-
onToggleSyncThisDevice = (event: React.ChangeEvent<HTMLInputElement>) => {
106-
this.props.actions.onToggleSyncThisDevice(event.target.checked)
107-
}
108-
109103
onSyncBookmarks = (event: React.ChangeEvent<HTMLInputElement>) => {
110104
this.props.actions.onSyncBookmarks(event.target.checked)
111105
}
@@ -139,23 +133,6 @@ class SyncEnabledContent extends React.PureComponent<SyncEnabledContentProps, Sy
139133
? <ResetSyncModal actions={actions} onClose={this.resetSyncModal} />
140134
: null
141135
}
142-
<Card>
143-
<Grid columns='1fr 1fr'>
144-
<FlexColumn items='center'>
145-
<SwitchButton
146-
id='syncThisDevice'
147-
size='large'
148-
checked={syncData.shouldSyncThisDevice}
149-
onChange={this.onToggleSyncThisDevice}
150-
/>
151-
<SwitchLabel htmlFor='syncThisDevice'>{getLocale('syncThisDevice')}</SwitchLabel>
152-
</FlexColumn>
153-
<FlexColumn direction='column'>
154-
<Label>{getLocale('deviceName')}</Label>
155-
<Paragraph>{syncData.thisDeviceName}</Paragraph>
156-
</FlexColumn>
157-
</Grid>
158-
</Card>
159136
<SectionBlock>
160137
<SubTitle level={2}>{getLocale('devices')}</SubTitle>
161138
<Table header={this.header} rows={this.getRows(syncData.devices)}>

components/brave_sync/ui/constants/sync_types.ts

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ export const enum types {
1313
SYNC_ON_REQUEST_SYNC_WORDS = '@@sync/SYNC_ON_REQUEST_SYNC_WORDS',
1414
SYNC_ON_REMOVE_DEVICE = '@@sync/SYNC_ON_REMOVE_DEVICE',
1515
SYNC_ON_RESET = '@@sync/SYNC_ON_RESET',
16-
SYNC_ON_SYNC_THIS_DEVICE = '@@sync/SYNC_ON_SYNC_THIS_DEVICE',
1716
SYNC_BOOKMARKS = '@@sync/SYNC_BOOKMARKS',
1817
SYNC_SAVED_SITE_SETTINGS = '@@sync/SYNC_SAVED_SITE_SETTINGS',
1918
SYNC_BROWSING_HISTORY = '@@sync/SYNC_BROWSING_HISTORY',

components/brave_sync/ui/reducers/sync_reducer.ts

-8
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ const syncReducer: Reducer<Sync.State | undefined> = (state: Sync.State | undefi
3838
...state,
3939
devices: [ ...devices ],
4040
isSyncConfigured: payload.settings.sync_configured,
41-
shouldSyncThisDevice: payload.settings.sync_this_device,
4241
thisDeviceName: payload.settings.this_device_name,
4342
syncBookmarks: payload.settings.sync_bookmarks,
4443
syncSavedSiteSettings: payload.settings.sync_settings,
@@ -101,13 +100,6 @@ const syncReducer: Reducer<Sync.State | undefined> = (state: Sync.State | undefi
101100
chrome.send('deleteDevice', [payload.id])
102101
break
103102

104-
case types.SYNC_ON_SYNC_THIS_DEVICE:
105-
if (typeof payload.shouldSyncThisDevice === 'undefined') {
106-
break
107-
}
108-
chrome.send('syncThisDevice', [payload.shouldSyncThisDevice])
109-
break
110-
111103
case types.SYNC_BOOKMARKS:
112104
if (typeof payload.shouldEnable === 'undefined') {
113105
break

components/brave_sync/ui/storage.ts

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ export const defaultState = {
1111
thisDeviceName: '',
1212
devices: [],
1313
isSyncConfigured: false,
14-
shouldSyncThisDevice: true,
1514
seedQRImageSource: '',
1615
syncWords: '',
1716
syncBookmarks: true,

components/definitions/sync.d.ts

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ declare namespace Sync {
2525
thisDeviceName: string
2626
devices: Devices[]
2727
isSyncConfigured: boolean
28-
shouldSyncThisDevice: boolean
2928
seedQRImageSource: string
3029
syncWords: string
3130
syncBookmarks: boolean

components/resources/brave_components_strings.grd

-1
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,6 @@
414414
<message name="IDS_BRAVE_SYNC_TITLE_BETA" desc="The Brave Sync beta label">beta</message>
415415
<message name="IDS_BRAVE_SYNC_INFO_1" desc="">Sync encrypted browser data between your devices securely and privately using Brave Sync</message>
416416
<message name="IDS_BRAVE_SYNC_INFO_2" desc="The Brave Sync decription about usage on mobile devices">Note: Sync for iOS and Android is still being completed and will be released soon.</message>
417-
<message name="IDS_BRAVE_SYNC_DEVICE_SYNC" desc="">Sync this device</message>
418417

419418
<message name="IDS_BRAVE_SYNC_DONE" desc="The Brave Sync `Done` button">Done</message>
420419
<message name="IDS_BRAVE_SYNC_CANCEL" desc="The Brave Sync `Cancel` button">Cancel</message>

components/test/brave_sync_ui/actions/sync_actions_test.ts

-8
Original file line numberDiff line numberDiff line change
@@ -90,14 +90,6 @@ describe('sync_actions', () => {
9090
})
9191
})
9292

93-
it('onToggleSyncThisDevice', () => {
94-
expect(actions.onToggleSyncThisDevice(true)).toEqual({
95-
type: types.SYNC_ON_SYNC_THIS_DEVICE,
96-
meta: undefined,
97-
payload: { shouldSyncThisDevice: true }
98-
})
99-
})
100-
10193
it('onSyncBookmarks', () => {
10294
expect(actions.onSyncBookmarks(true)).toEqual({
10395
type: types.SYNC_BOOKMARKS,

components/test/brave_sync_ui/reducers/sync_reducer_test.ts

-4
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,6 @@ describe.skip('syncReducer', () => {
4747
// TODO
4848
})
4949

50-
describe('SYNC_ON_SYNC_THIS_DEVICE', () => {
51-
// TODO
52-
})
53-
5450
describe('SYNC_BOOKMARKS', () => {
5551
// TODO
5652
})

0 commit comments

Comments
 (0)