From de3054b485256b8747a062ede778765abba7a8b2 Mon Sep 17 00:00:00 2001 From: gorhill Date: Sat, 29 Oct 2016 08:42:29 -0400 Subject: [PATCH] code review re. 3628de7a9dc4022a373295d548e05d424db0f8cf --- src/js/assets.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/js/assets.js b/src/js/assets.js index f993fbbd2..fedbd1c8d 100644 --- a/src/js/assets.js +++ b/src/js/assets.js @@ -1046,7 +1046,13 @@ var readUserAsset = function(path, callback) { var saveUserAsset = function(path, content, callback) { var bin = {}; bin[path] = content; - vAPI.storage.set(bin, callback); + var onSaved; + if ( callback instanceof Function ) { + onSaved = function() { + callback({ path: path, content: content }); + }; + } + vAPI.storage.set(bin, onSaved); }; /******************************************************************************/