sync v2 #13197
sync v2 #13197
Changes from 1 commit
29fe1b0
a1c0d9f
1f16ca6
61c8577
a42ff23
bf2990b
764b09b
14dddad
f8cc3d2
3e9365c
23cf563
ef16e81
f592805
9b27f97
a1865b2
3ba5860
File filter...
Jump to…
allow sync devices to be removed
- Loading branch information
Unverified
| @@ -370,6 +370,7 @@ syncRemoveDevice.title=Remove this device | ||
| syncRemoveActiveDeviceWarning1=Local device data will remain intact on all devices. Other devices in this sync chain will remain sync'd. | ||
bradleyrichter
Contributor
|
||
| syncRemoveActiveDeviceWarning2=To join a sync chain again, choose "Enter a sync chain code". | ||
| syncRemoveOtherDeviceWarning= Note: Removing this device from this sync chain does not clear previously sync'd data from the device. | ||
|
||
| syncReset=Reset Sync | ||
| syncResetDataDisabled=This feature is only available when Sync is enabled. | ||
| syncRetryButton=Try again | ||
| syncScanMobile=Now, using Brave on your mobile device, scan this code | ||
| @@ -34,6 +34,7 @@ const {HrtimeLogger} = require('../../app/common/lib/logUtil') | ||
| const platformUtil = require('../../app/common/lib/platformUtil') | ||
| const urlUtil = require('../lib/urlutil') | ||
| const buildConfig = require('../constants/buildConfig') | ||
| const {getSetting} = require('../../js/settings') | ||
|
|
||
| // state helpers | ||
| const {makeImmutable, findNullKeyPaths} = require('../../app/common/state/immutableUtil') | ||
| @@ -555,6 +556,7 @@ const handleAppAction = (action) => { | ||
| } | ||
| break | ||
| case appConstants.APP_SAVE_SYNC_DEVICES: | ||
| const hasMainDevice = appState.getIn(['sync', 'devices']).some(device => device.get('mainDevice')) | ||
| for (let deviceId of Object.keys(action.devices)) { | ||
| const device = action.devices[deviceId] | ||
| if (device.lastRecordTimestamp) { | ||
| @@ -563,6 +565,9 @@ const handleAppAction = (action) => { | ||
| if (device.name) { | ||
| appState = appState.setIn(['sync', 'devices', deviceId, 'name'], device.name) | ||
| } | ||
| if (!hasMainDevice && getSetting(settings.SYNC_DEVICE_NAME) === device.name) { | ||
diracdeltas
Member
|
||
| appState = appState.setIn(['sync', 'devices', deviceId, 'mainDevice'], true) | ||
|
||
| } | ||
| } | ||
| break | ||
| case appConstants.APP_SAVE_SYNC_INIT_DATA: | ||
| @@ -609,6 +614,9 @@ const handleAppAction = (action) => { | ||
| appState = appState.setIn(['sync', 'devices'], {}) | ||
| appState = appState.setIn(['sync', 'objectsById'], {}) | ||
| break | ||
| case appConstants.APP_REMOVE_SYNC_DEVICE: | ||
| appState = appState.deleteIn(['sync', 'devices', action.deviceId]) | ||
diracdeltas
Member
|
||
| break | ||
| case appConstants.APP_SETUP_SYNC_COMPLETED: | ||
| appState = appState.setIn(['sync', 'setupCompleted'], action.isCompleted) | ||
| break | ||
can we use
syncedinstead ofsync'd(which isn't a word)?