Skip to content

Commit

Permalink
Save new version fix and migrate fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ramvibhakar committed Aug 19, 2015
1 parent 9ba2d02 commit a4b1c0f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
}
//save to cache
if (!overwriteSave) {
if (_canvasView._isNewSketch) {
_cacheControl.addToCache(objDoc);
} else {
_cacheControl.updateCache(objDoc);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,13 @@ public class KSketch_MigrateCache {
public function KSketch_MigrateCache() {
}
public function migrateData(){
if(_mySOV1.data){
if(_mySOV1.data != null){
if(_mySOV1.data.userSketch) {
var obj:Object = com.adobe.serialization.json.JSON.decode(_mySOV1.data.userSketch, true);
buildCacheV2(obj.sketches)
}
if(_mySOV1.data.user){
_cacheControl.user = com.adobe.serialization.json.JSON.decode(_mySOV1.data.user,true);
} else {
_cacheControl.newUser();
}
_mySOV1.clear();
}
Expand Down
12 changes: 10 additions & 2 deletions KSKInterface/src/sg/edu/smu/ksketch2/utils/KWebData.as
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,16 @@ import mx.utils.UIDUtil;
if(userData.sketchData.originalName != "" && (sketchName == userData.sketchData.originalName))
{
data.sketchId = userData.sketchData.sketchId;
data.originalVersion = userData.sketchData.originalVersion;
data.originalSketch = userData.sketchData.originalSketch;
if((userData.sketchData as Object).hasOwnProperty('originalVersion')) {
data.originalVersion = userData.sketchData.originalVersion;
} else {
data.originalVersion = userData.sketchData.version;
}
if((userData.sketchData as Object).hasOwnProperty('originalSketch')) {
data.originalSketch = userData.sketchData.originalSketch;
} else {
data.originalSketch = userData.sketchData.originalSketchId;
}
data.originalName = userData.sketchData.originalName;
}
else
Expand Down

0 comments on commit a4b1c0f

Please sign in to comment.