mirror of
https://codeberg.org/PLG-Development/PLG-MuDiCS
synced 2026-07-06 00:47:09 +00:00
chore(control): Keyboard queue (#31)
Co-authored-by: 2mal3 <56305732+2mal3@users.noreply.github.com>
This commit is contained in:
@@ -201,7 +201,7 @@ export async function run_on_all_selected_displays(
|
||||
);
|
||||
const displays: Display[] = maybe_displays.filter((d): d is Display => d !== null);
|
||||
|
||||
Promise.all(
|
||||
await Promise.all(
|
||||
displays.map(async (display) => {
|
||||
if (!display || (ignore_offline && display.status === 'host_offline')) return;
|
||||
await run_function(display);
|
||||
|
||||
@@ -113,3 +113,12 @@ export function get_sanitized_file_url(file_path: string, is_preview = false) {
|
||||
|
||||
return `/file/${is_preview ? 'preview/' : ''}${[...pathSegments].join('/')}`;
|
||||
}
|
||||
|
||||
|
||||
let keyboard_queue = Promise.resolve();
|
||||
|
||||
export function add_to_keyboard_queue(task: () => Promise<void>) {
|
||||
keyboard_queue = keyboard_queue.then(task).catch((err) => {
|
||||
console.error('Error in input queue:', err);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user