Skip to content

Commit

Permalink
bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
shatting committed Apr 26, 2011
1 parent 8032a4e commit f779923
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
1 change: 1 addition & 0 deletions javascripts/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ function handleRequest(request, sender, sendResponse) {
if (!SimplenoteDB.hadSync() && request.action != "login") {

log("handleRequest:starting initial sync.");
SimplenoteDB.reset();
backgroundSync(true, function() {
log("handleRequest:initial sync done.");
handleRequest(request, sender, sendResponse);
Expand Down
2 changes: 1 addition & 1 deletion javascripts/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// ------------------------------------------------------------------------------------------------

// global debug switch
var commonDebug = true;
var commonDebug = false;

function logGeneral(s,prefix,target) {
if (!commonDebug)
Expand Down
11 changes: 7 additions & 4 deletions javascripts/popup.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,9 +67,12 @@ chrome.extension.onRequest.addListener(function (eventData, sender, sendResponse
fillTags(true);
} else if (eventData.name == "noteupdated") {
log("EventListener:" + eventData.name);
if (eventData.changes.changed.indexOf("deleted")>=0)
if (eventData.changes.changed.indexOf("deleted")>=0) {
$('div.noterow#' + eventData.newnote.key).hide()
else {
fillTags(false);
} else if (eventData.changes.changed.indexOf("systemtags")>=0 || eventData.changes.changed.indexOf("modifydate")>=0) {
fillTags(true);
} else {
indexAddNote("replace", eventData.newnote);
indexFillNote(eventData.newnote);
}
Expand Down Expand Up @@ -297,7 +300,7 @@ function indexAddNote(mode, note){
shareds.push(tag);
}
});
if (note.sharekey != undefined)
if (shareds.length > 0)
html+= "<div class='shared' id='" + note.key + "shared' title='Shared with " + shareds.join(", ") + "'>&nbsp;</div>";
}
html+= "<div class='noteheading' id='" + note.key + "heading'>";
Expand Down Expand Up @@ -831,7 +834,7 @@ function editorNoteChanged(key) {
else if (key != '' ) { // existing note, new data -> update
noteData.key = key;
noteData.action = "update";
} else if (noteData.content != '') // new note, new data -> create
} else if (noteData.content && noteData.content != '') // new note, new data -> create
noteData.action = "create";

slideIndex();
Expand Down
10 changes: 10 additions & 0 deletions javascripts/simplenoteDB.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,14 @@ var SimplenoteDB = {
}
},

reset : function() {
this.isSyncInProgress = false;
this.syncCallbackChunk = undefined;
this.syncCallbackFinished = undefined;
delete this._indexKeysTemp;
delete this._indexKeysChanged;
},

isSyncInProgress : false,

// jsut to detect whether we actually had a sync
Expand Down Expand Up @@ -161,6 +169,8 @@ var SimplenoteDB = {
this.log("_gotIndexChunk: changed " + this._indexKeysChanged.changed.length);
if (this._indexKeysChanged.deleted.length > 0)
this.log("_gotIndexChunk: deleted " + this._indexKeysChanged.deleted.length);

delete this._indexKeysChanged;
}
},

Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Simplenote+",
"version": "1.4.7",
"version": "1.4.7.1",
"description": "Access your Simplenote notes right from your chrome extension bar.",
"icons": {
"96": "imanges/logo_96.png",
Expand Down

0 comments on commit f779923

Please sign in to comment.