From df193a99cd84ec52dba6acce356a7e0acc4d6027 Mon Sep 17 00:00:00 2001 From: "D. Berge" Date: Mon, 28 Jul 2025 12:02:49 +0200 Subject: [PATCH] Add sleep() method to main.js. Useful when the UI needs to "pause" for UX reasons. Can be called from any component with `this.$root.sleep(ms)`. --- lib/www/client/source/src/main.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/www/client/source/src/main.js b/lib/www/client/source/src/main.js index 7f7e9a1..153c164 100644 --- a/lib/www/client/source/src/main.js +++ b/lib/www/client/source/src/main.js @@ -46,6 +46,12 @@ new Vue({ methods: { + async sleep (ms = 0) { + return await new Promise( (resolve) => { + setTimeout( resolve, ms ); + }); + }, + markdown (value) { return markdown(value); },