mirror of
https://github.com/zero-peak/ZeroOmega.git
synced 2025-01-22 15:08:12 -05:00
remove disabled sync option
This commit is contained in:
parent
87ae344677
commit
f33ba4d47a
@ -259,6 +259,10 @@ class Options
|
|||||||
color: '#00cccc'
|
color: '#00cccc'
|
||||||
)
|
)
|
||||||
version = changes['schemaVersion'] = options['schemaVersion'] = 2
|
version = changes['schemaVersion'] = options['schemaVersion'] = 2
|
||||||
|
OmegaPac.Profiles.each options, (key, profile) ->
|
||||||
|
if profile.syncOptions is 'disabled'
|
||||||
|
delete profile['syncOptions']
|
||||||
|
delete profile['syncError']
|
||||||
if version == 2
|
if version == 2
|
||||||
# Current schemaVersion.
|
# Current schemaVersion.
|
||||||
Promise.resolve([options, changes])
|
Promise.resolve([options, changes])
|
||||||
|
@ -50,7 +50,6 @@ class OptionsSync
|
|||||||
###*
|
###*
|
||||||
# Merge newVal and oldVal of a given key. The default implementation choose
|
# Merge newVal and oldVal of a given key. The default implementation choose
|
||||||
# between newVal and oldVal based on the following rules:
|
# between newVal and oldVal based on the following rules:
|
||||||
# 1. Choose oldVal if syncOptions is 'disabled' in either oldVal or newVal.
|
|
||||||
# 2. Choose oldVal if it has a revision newer than or equal to that of newVal.
|
# 2. Choose oldVal if it has a revision newer than or equal to that of newVal.
|
||||||
# 3. Choose oldVal if it deeply equals newVal.
|
# 3. Choose oldVal if it deeply equals newVal.
|
||||||
# 4. Otherwise, choose newVal.
|
# 4. Otherwise, choose newVal.
|
||||||
@ -67,8 +66,6 @@ class OptionsSync
|
|||||||
)
|
)
|
||||||
return (key, newVal, oldVal) ->
|
return (key, newVal, oldVal) ->
|
||||||
return oldVal if newVal == oldVal
|
return oldVal if newVal == oldVal
|
||||||
if oldVal?.syncOptions == 'disabled' or newVal?.syncOptions == 'disabled'
|
|
||||||
return oldVal
|
|
||||||
if oldVal?.revision? and newVal?.revision?
|
if oldVal?.revision? and newVal?.revision?
|
||||||
result = Revision.compare(oldVal.revision, newVal.revision)
|
result = Revision.compare(oldVal.revision, newVal.revision)
|
||||||
return oldVal if result >= 0
|
return oldVal if result >= 0
|
||||||
@ -176,9 +173,6 @@ class OptionsSync
|
|||||||
###
|
###
|
||||||
copyTo: (local) ->
|
copyTo: (local) ->
|
||||||
Promise.join local.get(null), @storage.get(null), (base, changes) =>
|
Promise.join local.get(null), @storage.get(null), (base, changes) =>
|
||||||
for own key of base when not (key of changes)
|
|
||||||
if key[0] == '+' and not base[key]?.syncOptions == 'disabled'
|
|
||||||
changes[key] = undefined
|
|
||||||
local.apply(
|
local.apply(
|
||||||
changes: changes
|
changes: changes
|
||||||
base: base
|
base: base
|
||||||
|
Loading…
Reference in New Issue
Block a user