mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-10-31 04:51:31 +08:00 
			
		
		
		
	don't alert in case of updated note in current editor
This commit is contained in:
		
							parent
							
								
									702d47e6b0
								
							
						
					
					
						commit
						cf45594d89
					
				| @ -13,14 +13,11 @@ function checkStatus() { | |||||||
|                 loadTree().then(resp => { |                 loadTree().then(resp => { | ||||||
|                     console.log("Reloading tree because of background changes"); |                     console.log("Reloading tree because of background changes"); | ||||||
| 
 | 
 | ||||||
|  |                     // this will also reload the note content
 | ||||||
|                     globalTree.fancytree('getTree').reload(resp.notes); |                     globalTree.fancytree('getTree').reload(resp.notes); | ||||||
|                 }); |                 }); | ||||||
|             } |             } | ||||||
| 
 | 
 | ||||||
|             if (resp.changedCurrentNote) { |  | ||||||
|                 alert("Current note has been changed in different window / computer. Please reload the application and resolve the conflict manually."); |  | ||||||
|             } |  | ||||||
| 
 |  | ||||||
|             $("#changesToPushCount").html(resp.changesToPushCount); |             $("#changesToPushCount").html(resp.changesToPushCount); | ||||||
|         }, |         }, | ||||||
|         statusCode: { |         statusCode: { | ||||||
|  | |||||||
| @ -11,7 +11,7 @@ const auth = require('../../services/auth'); | |||||||
| router.get('/:noteId', auth.checkApiAuth, async (req, res, next) => { | router.get('/:noteId', auth.checkApiAuth, async (req, res, next) => { | ||||||
|     let noteId = req.params.noteId; |     let noteId = req.params.noteId; | ||||||
| 
 | 
 | ||||||
|     await sql.execute("update options set opt_value = ? where opt_name = 'start_node'", [noteId]); |     await options.setOption('start_node', noteId); | ||||||
| 
 | 
 | ||||||
|     let detail = await sql.getSingleResult("select * from notes where note_id = ?", [noteId]); |     let detail = await sql.getSingleResult("select * from notes where note_id = ?", [noteId]); | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -253,7 +253,7 @@ function logSyncError(message, e, syncLog) { | |||||||
| async function updateNote(entity, links, sourceId, syncLog) { | async function updateNote(entity, links, sourceId, syncLog) { | ||||||
|     const origNote = await sql.getSingleResult("select * from notes where note_id = ?", [entity.note_id]); |     const origNote = await sql.getSingleResult("select * from notes where note_id = ?", [entity.note_id]); | ||||||
| 
 | 
 | ||||||
|     if (origNote === null || origNote.date_modified <= entity.date_modified) { |     if (!origNote || origNote.date_modified <= entity.date_modified) { | ||||||
|         await sql.doInTransaction(async () => { |         await sql.doInTransaction(async () => { | ||||||
|             await sql.replace("notes", entity); |             await sql.replace("notes", entity); | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 azivner
						azivner