Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
betocantu93 committed Apr 16, 2021
1 parent 65b528b commit a186905
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions addon/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,19 @@ function tryContent(ctx) {
return ctx._content ? ctx._content : ctx.content ? ctx.content : ctx;
}

function deepNotifyPropertyChange(obj, path) {
function deepNotifyPropertyChange(changeset, path) {
let paths = path.split('.');
let maybeDynamicPathToNotify = null,
lastPath = paths.pop(),
current = obj,
current = changeset,
i;

let exists = safeGet(obj._content, path) !== undefined;
//If the path doesn't exists previously exist inside the CONTENT, this is a dynamic set.
let existsInContent = safeGet(changeset[CONTENT], path) !== undefined;

for (i = 0; i < paths.length; ++i) {
const curr = current[paths[i]];
if (exists && curr.content === curr.content) {
if (existsInContent && curr && curr.content === curr.content) {
current = current[paths[i]];
} else {
maybeDynamicPathToNotify = paths[i];
Expand Down

0 comments on commit a186905

Please sign in to comment.