mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 18:36:30 +01:00 
			
		
		
		
	client: Remove errors in log when changing a setting
This commit is contained in:
		| @@ -135,7 +135,11 @@ function ajax(url, method, data, headers, silentNotFound) { | ||||
|                 }); | ||||
|             }, | ||||
|             error: async jqXhr => { | ||||
|                 if (silentNotFound && jqXhr.status === 404) { | ||||
|                 if (jqXhr.status === 0) { | ||||
|                     // don't report requests that are rejected by the browser, usually when the user is refreshing or going to a different page. | ||||
|                     rej("rejected by browser"); | ||||
|                     return; | ||||
|                 } else if (silentNotFound && jqXhr.status === 404) { | ||||
|                     // report nothing | ||||
|                 } else { | ||||
|                     await reportError(method, url, jqXhr.status, jqXhr.responseText); | ||||
|   | ||||
| @@ -57,7 +57,17 @@ class NoteContextAwareWidget extends BasicWidget { | ||||
|     async refresh() { | ||||
|         if (this.isEnabled()) { | ||||
|             this.toggleInt(true); | ||||
|  | ||||
|             try { | ||||
|                 await this.refreshWithNote(this.note); | ||||
|             } catch (e) { | ||||
|                 // Ignore errors when user is refreshing or navigating away. | ||||
|                 if (e === "rejected by browser") { | ||||
|                     return; | ||||
|                 } | ||||
|  | ||||
|                 throw e; | ||||
|             } | ||||
|         } | ||||
|         else { | ||||
|             this.toggleInt(false); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user