Skip to content

Commit

Permalink
Duplicating sketch fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ramvibhakar committed Aug 21, 2015
1 parent e951af5 commit 0ca9718
Showing 1 changed file with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ package sg.edu.smu.ksketch2.canvas.controls
sketchData = new KSketch_DataListItem(resultObj.data.fileData, resultObj.data.fileName, resultObj.data.originalName,
resultObj.data.owner_id, resultObj.modified, resultObj.data.changeDescription,
resultObj.data.sketchId, resultObj.data.version);
updateCache(resultObj.data);
updateCache(resultObj.data, false);
} else {
this.dataFaultHandler(null);
}
Expand Down Expand Up @@ -349,7 +349,7 @@ package sg.edu.smu.ksketch2.canvas.controls
_mySO.clear();
}

public function addToCache(sketchObj: Object):void
public function addToCache(sketchObj: Object,toBeUpdated:Boolean = true):void
{
var arr:Array = cachedDocuments;
if(arr == null){
Expand All @@ -360,16 +360,21 @@ package sg.edu.smu.ksketch2.canvas.controls
var list:SortedList = cachedList;
var obj:KSketch_ListItem = new KSketch_ListItem();
obj.fromCache(sketchObj);
obj.isSaved = false;
if(toBeUpdated) {
obj.isSaved = false;
}else{
obj.isSaved = true;
}
obj.uniqueId = sketchObj.uniqueId;
list.add(obj);
cachedList = list;
}

public function updateCache(sketchObj: Object):void
public function updateCache(sketchObj: Object, toBeUpdated:Boolean = true):void
{
this.deleteFromCache(sketchObj.sketchId,sketchObj.fileName);
this.addToCache(sketchObj);
this.addToCache(sketchObj,toBeUpdated);

}

public function updateSketchDocument(uniqueId:String, sketchId:Number){
Expand Down

0 comments on commit 0ca9718

Please sign in to comment.