Skip to content

Commit

Permalink
New: Treat _isLocked as a lockable attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
oliverfoster committed Sep 25, 2024
1 parent 6a84eb5 commit c56bc23
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions js/models.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,13 +197,13 @@ export function applyLocks() {
const modelsById = {};
// Fetch the component model from the store incase it needs overriding by another extension
const TrickleButtonModel = components.getModelClass('trickle-button');
const setDescendantLocks = ((model, id) => {
const setDescendantLocks = (model, id) => {
model.getAllDescendantModels().forEach(descendant => {
const descendantId = descendant.get('_id');
modelsById[descendantId] = descendant;
locks[descendantId] = locks[id];
});
});
};
// Check all models for trickle potential
Adapt.course.getAllDescendantModels(true).filter(model => model.get('_isAvailable')).forEach(siteModel => {
const trickleConfig = getModelConfig(siteModel);
Expand Down Expand Up @@ -236,7 +236,7 @@ export function applyLocks() {
const model = modelsById[id];
const wasLocked = model.get('_isLocked');
if (wasLocked === isModelLocked) return;
model.set('_isLocked', isModelLocked);
model.set('_isLocked', isModelLocked, { pluginName: 'trickle' });
});
logTrickleState();
}
Expand Down

0 comments on commit c56bc23

Please sign in to comment.