mirror of
				https://github.com/zadam/trilium.git
				synced 2025-11-04 05:28:59 +01:00 
			
		
		
		
	move sleep to general utisl function
This commit is contained in:
		
							parent
							
								
									d2975bbd21
								
							
						
					
					
						commit
						a168edb168
					
				@ -359,6 +359,12 @@ function isValidAttributeName(name) {
 | 
			
		||||
    return ATTR_NAME_MATCHER.test(name);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
function sleep(time_ms) {
 | 
			
		||||
    return new Promise((resolve) => {
 | 
			
		||||
        setTimeout(resolve, time_ms);
 | 
			
		||||
    });
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export default {
 | 
			
		||||
    reloadFrontendApp,
 | 
			
		||||
    parseDate,
 | 
			
		||||
@ -402,5 +408,6 @@ export default {
 | 
			
		||||
    initHelpButtons,
 | 
			
		||||
    openHelp,
 | 
			
		||||
    filterAttributeName,
 | 
			
		||||
    isValidAttributeName
 | 
			
		||||
    isValidAttributeName,
 | 
			
		||||
    sleep,
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
@ -1,7 +0,0 @@
 | 
			
		||||
export const sleep = (time_ms) => {
 | 
			
		||||
  return new Promise((resolve) => {
 | 
			
		||||
    setTimeout(resolve, time_ms);
 | 
			
		||||
  });
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
export default sleep;
 | 
			
		||||
@ -1,12 +1,13 @@
 | 
			
		||||
import libraryLoader from "../../services/library_loader.js";
 | 
			
		||||
import TypeWidget from "./type_widget.js";
 | 
			
		||||
import appContext from "../../services/app_context.js";
 | 
			
		||||
import sleep from './canvas-note-utils/sleep.js';
 | 
			
		||||
import utils from '../../services/utils.js';
 | 
			
		||||
import froca from "../../services/froca.js";
 | 
			
		||||
import debounce from "./canvas-note-utils/lodash.debounce.js";
 | 
			
		||||
import uniqueId from "./canvas-note-utils/lodash.uniqueId.js";
 | 
			
		||||
import replaceExternalAssets from "./canvas-note-utils/replaceExternalAssets.js";
 | 
			
		||||
 | 
			
		||||
const {sleep} = utils;
 | 
			
		||||
 | 
			
		||||
const TPL = `
 | 
			
		||||
    <div class="canvas-note-widget note-detail-canvas-note note-detail-printable note-detail">
 | 
			
		||||
        <style type="text/css">
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user