Extension default value
This commit is contained in:
@@ -51,7 +51,12 @@ class Action {
|
||||
class Extension extends Item {
|
||||
constructor(json) {
|
||||
super(json);
|
||||
_.merge(this, json);
|
||||
|
||||
if(this.encrypted === null || this.encrypted === undefined) {
|
||||
// Default to encrypted on creation.
|
||||
this.encrypted = true;
|
||||
}
|
||||
|
||||
if(json.actions) {
|
||||
this.actions = json.actions.map(function(action){
|
||||
return new Action(action);
|
||||
|
||||
@@ -89,6 +89,10 @@ class ExtensionManager {
|
||||
}
|
||||
|
||||
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});
|
||||
if(extension) {
|
||||
this.updateExtensionFromRemoteResponse(extension, externalResponseItem);
|
||||
|
||||
Reference in New Issue
Block a user