Extension default value
This commit is contained in:
@@ -51,7 +51,12 @@ class Action {
|
|||||||
class Extension extends Item {
|
class Extension extends Item {
|
||||||
constructor(json) {
|
constructor(json) {
|
||||||
super(json);
|
super(json);
|
||||||
_.merge(this, json);
|
|
||||||
|
if(this.encrypted === null || this.encrypted === undefined) {
|
||||||
|
// Default to encrypted on creation.
|
||||||
|
this.encrypted = true;
|
||||||
|
}
|
||||||
|
|
||||||
if(json.actions) {
|
if(json.actions) {
|
||||||
this.actions = json.actions.map(function(action){
|
this.actions = json.actions.map(function(action){
|
||||||
return new Action(action);
|
return new Action(action);
|
||||||
|
|||||||
@@ -89,6 +89,10 @@ class ExtensionManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
handleExtensionLoadExternalResponseItem(url, externalResponseItem) {
|
handleExtensionLoadExternalResponseItem(url, externalResponseItem) {
|
||||||
|
// Don't allow remote response to set these flags
|
||||||
|
delete externalResponseItem.encrypted;
|
||||||
|
delete externalResponseItem.uuid;
|
||||||
|
|
||||||
var extension = _.find(this.extensions, {url: url});
|
var extension = _.find(this.extensions, {url: url});
|
||||||
if(extension) {
|
if(extension) {
|
||||||
this.updateExtensionFromRemoteResponse(extension, externalResponseItem);
|
this.updateExtensionFromRemoteResponse(extension, externalResponseItem);
|
||||||
|
|||||||
Reference in New Issue
Block a user