mirror of
https://github.com/leanote/desktop-app.git
synced 2026-02-02 02:01:55 +08:00
0.3.4
This commit is contained in:
18
src/node_modules/file.js
generated
vendored
18
src/node_modules/file.js
generated
vendored
@@ -377,16 +377,16 @@ var File = {
|
||||
|
||||
// 访问api, 得到图片
|
||||
function getImageFromApi() {
|
||||
console.log('fetch servers image ' + fileId);
|
||||
// console.log('fetch servers image ' + fileId);
|
||||
Api.getImage(fileId, function(fileLocalPath, filename) {
|
||||
if(fileLocalPath) {
|
||||
console.log('save image to local');
|
||||
// console.log('save image to local');
|
||||
// 保存到本地数据库中
|
||||
me.addImageForce(fileId, fileLocalPath, function(doc) {
|
||||
if(doc) {
|
||||
console.log('save image to local success');
|
||||
// console.log('save image to local success');
|
||||
} else {
|
||||
console.log('save image to local error');
|
||||
// console.log('save image to local error');
|
||||
}
|
||||
callback(fileLocalPath);
|
||||
// return me.retImage(fileLocalPath, res);
|
||||
@@ -394,8 +394,8 @@ var File = {
|
||||
} else {
|
||||
// 远程取不到图片, 是没有网络? 还是远程真的没有了
|
||||
// TODO
|
||||
console.log("cann't get server's image" + fileId);
|
||||
callback(false);
|
||||
// console.log("cann't get server's image" + fileId);
|
||||
// callback(false);
|
||||
// return me.e404(res);
|
||||
}
|
||||
});
|
||||
@@ -404,13 +404,13 @@ var File = {
|
||||
// has表示本地数据库有记录
|
||||
me.getImageLocalPath(fileId, function(has, fileLocalPath) {
|
||||
// 本地有
|
||||
console.log('re img')
|
||||
console.log(fileLocalPath);
|
||||
// console.log('re img')
|
||||
// console.log(fileLocalPath);
|
||||
// console.log(fs.exists(fileLocalPath));
|
||||
if(has && fileLocalPath) {
|
||||
fs.exists(fileLocalPath, function(exists) {
|
||||
if(exists) {
|
||||
console.log('本地存在');
|
||||
// console.log('本地存在');
|
||||
callback(fileLocalPath);
|
||||
// me.retImage(fileLocalPath, res);
|
||||
} else {
|
||||
|
||||
6
src/node_modules/note.js
generated
vendored
6
src/node_modules/note.js
generated
vendored
@@ -102,7 +102,7 @@ var Note = {
|
||||
// 只有title, Content, Tags修改了才算是IsDirty
|
||||
if('Content' in updates && dbNote['Content'] != updates['Content']) {
|
||||
isDirty = true;
|
||||
console.error(' content not same');
|
||||
// console.error(' content not same');
|
||||
|
||||
// ContentIsDirty 才会发Content
|
||||
updates['ContentIsDirty'] = true;
|
||||
@@ -124,8 +124,8 @@ var Note = {
|
||||
updates['LocalIsDelete'] = false;
|
||||
updates.UpdatedTime = date;
|
||||
|
||||
console.log('finally update:');
|
||||
console.log(updates);
|
||||
// console.log('finally update:');
|
||||
// console.log(updates);
|
||||
|
||||
// Set an existing field's value
|
||||
Notes.update({NoteId: noteOrContent.NoteId}, { $set: updates }, {}, function (err, numReplaced) {
|
||||
|
||||
Reference in New Issue
Block a user