MCPcopy Index your code
hub / github.com/stemdeckapp/stemdeck / startProgressStatus

Function startProgressStatus

desktop/ui/setup.js:66–85  ·  view source on GitHub ↗
(messages)

Source from the content-addressed store, hash-verified

64}
65
66function startProgressStatus(messages) {
67 const startedAt = Date.now();
68 let messageIndex = 0;
69
70 const update = () => {
71 const elapsedSeconds = Math.floor((Date.now() - startedAt) / 1000);
72 while (
73 messageIndex + 1 < messages.length &&
74 elapsedSeconds >= messages[messageIndex + 1].afterSeconds
75 ) {
76 messageIndex += 1;
77 }
78
79 setStatus(`${messages[messageIndex].text} Elapsed: ${formatElapsed(startedAt)}.`);
80 };
81
82 update();
83 const timer = window.setInterval(update, 1000);
84 return () => window.clearInterval(timer);
85}
86
87function isMac() {
88 return /mac/i.test(navigator.userAgentData?.platform ?? navigator.platform ?? "");

Callers 2

installRuntimePackFunction · 0.85
runSetupFunction · 0.85

Calls 1

updateFunction · 0.85

Tested by

no test coverage detected