mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-04 05:28:59 +01:00 
			
		
		
		
	status converted to module
This commit is contained in:
		
							parent
							
								
									ad7803f9dc
								
							
						
					
					
						commit
						60a3abdea9
					
				@ -1,4 +1,6 @@
 | 
			
		||||
const status = (function() {
 | 
			
		||||
    const treeEl = $("#tree");
 | 
			
		||||
    const $changesToPushCountEl = $("#changesToPushCount");
 | 
			
		||||
 | 
			
		||||
    async function checkStatus() {
 | 
			
		||||
        const resp = await $.ajax({
 | 
			
		||||
@ -34,7 +36,12 @@ async function checkStatus() {
 | 
			
		||||
            encryption.decryptTreeItems();
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
    $("#changesToPushCount").html(resp.changesToPushCount);
 | 
			
		||||
        $changesToPushCountEl.html(resp.changesToPushCount);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    setInterval(checkStatus, 5 * 1000);
 | 
			
		||||
 | 
			
		||||
    return {
 | 
			
		||||
        checkStatus
 | 
			
		||||
    };
 | 
			
		||||
})();
 | 
			
		||||
@ -4,7 +4,7 @@ function syncNow() {
 | 
			
		||||
        type: 'POST',
 | 
			
		||||
        success: result => {
 | 
			
		||||
            if (result.success) {
 | 
			
		||||
                checkStatus();
 | 
			
		||||
                status.checkStatus();
 | 
			
		||||
 | 
			
		||||
                message("Sync triggered.");
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user