Skip to content

Commit 5e129b1

Browse files
committed
fixed restriction on features
1 parent 89b3d5e commit 5e129b1

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/renderer/model/sources/lockedTracker.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,12 @@ export const lockedTracker = (source, store) => {
1212
const unlocked = key => !keySet.has(key)
1313

1414
;(async () => {
15-
store.on('batch', ({ operations }) => {
15+
store.on('batch', async ({ operations }) => {
1616
const candidates = operations
17-
.filter(({ key }) => ID.isLockedId(key))
17+
.filter(({ key }) => (ID.isLockedId(key) || ID.isRestrictedId(key)))
1818
.map(({ type, key }) => ({ type, key: ID.associatedId(key) }))
1919

20+
2021
const [additions, removals] = R.partition(({ type }) => type === 'put', candidates)
2122
additions.forEach(({ key }) => keySet.add(key))
2223
removals.forEach(({ key }) => keySet.delete(key))
@@ -25,7 +26,9 @@ export const lockedTracker = (source, store) => {
2526
source.dispatchEvent(new TouchFeaturesEvent(keys))
2627
})
2728

28-
const keys = await store.keys(ID.lockedId())
29+
const lockedKeys = await store.keys(ID.lockedId())
30+
const restrictedKeys = await store.keys(ID.restrictedId())
31+
const keys = [...lockedKeys, ...restrictedKeys]
2932
keys.forEach(key => keySet.add(ID.associatedId(key)))
3033
})()
3134

0 commit comments

Comments
 (0)