Do note check when hiding a component, SFJS 0.3.14
This commit is contained in:
@@ -637,9 +637,22 @@ angular.module('app')
|
|||||||
this.reloadComponentContext = function() {
|
this.reloadComponentContext = function() {
|
||||||
// componentStack is used by the template to ng-repeat
|
// componentStack is used by the template to ng-repeat
|
||||||
this.componentStack = componentManager.componentsForArea("editor-stack");
|
this.componentStack = componentManager.componentsForArea("editor-stack");
|
||||||
for(var component of this.componentStack) {
|
/*
|
||||||
if(component.active) {
|
In the past, we were doing this looping code even if the note wasn't currently defined.
|
||||||
component.hidden = !this.note || component.isExplicitlyDisabledForItem(this.note);
|
The problem is if an editor stack item loaded first, requested to stream items, and the note was undefined,
|
||||||
|
we would set component.hidden = true. Which means messages would not be sent to the component.
|
||||||
|
Theoretically, upon the note loading, we would run this code again, and unhide the extension.
|
||||||
|
However, if you had requested to stream items when it was hidden, and then it unhid, it would never
|
||||||
|
resend those items upon unhiding.
|
||||||
|
|
||||||
|
Our solution here is to check that the note is defined before setting hidden. The question remains, when
|
||||||
|
would note really ever be undefined? Maybe temprarily when you're deleting a note?
|
||||||
|
*/
|
||||||
|
if(this.note) {
|
||||||
|
for(var component of this.componentStack) {
|
||||||
|
if(component.active) {
|
||||||
|
component.hidden = component.isExplicitlyDisabledForItem(this.note);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
6
package-lock.json
generated
6
package-lock.json
generated
@@ -5907,9 +5907,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"standard-file-js": {
|
"standard-file-js": {
|
||||||
"version": "0.3.12",
|
"version": "0.3.14",
|
||||||
"resolved": "https://registry.npmjs.org/standard-file-js/-/standard-file-js-0.3.12.tgz",
|
"resolved": "https://registry.npmjs.org/standard-file-js/-/standard-file-js-0.3.14.tgz",
|
||||||
"integrity": "sha512-guxocxz0ID9xYYbfC/tTxsW9Gl9ELkmI+TV17XMNVOf5eRdC3N0rBL20x2g3d8yevdi6eUIxJHa9Llx3kM/ATQ==",
|
"integrity": "sha512-h5jrvFe5YdyxjoiYSvLzGSFe38Arr7NOtT5vMZliMum7OkNmFJkJbLfeFJZKkvpKRpNucPTPkSIGMSxNKKt1XQ==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"statuses": {
|
"statuses": {
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
"karma-jasmine": "^1.1.0",
|
"karma-jasmine": "^1.1.0",
|
||||||
"karma-phantomjs-launcher": "^1.0.2",
|
"karma-phantomjs-launcher": "^1.0.2",
|
||||||
"sn-stylekit": "1.0.15",
|
"sn-stylekit": "1.0.15",
|
||||||
"standard-file-js": "0.3.12",
|
"standard-file-js": "0.3.14",
|
||||||
"sn-models": "0.1.1",
|
"sn-models": "0.1.1",
|
||||||
"connect": "^3.6.6",
|
"connect": "^3.6.6",
|
||||||
"mocha": "^5.2.0",
|
"mocha": "^5.2.0",
|
||||||
|
|||||||
Reference in New Issue
Block a user