Remove unnecessary sleep function (#9)

This commit is contained in:
Steven Stallion 2025-03-20 22:02:45 -05:00 committed by GitHub
parent 1a8aefdf7f
commit 6d9da16303
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 6 additions and 7 deletions

View file

@ -1,6 +1,6 @@
*.*
!*.css
!*.json
!*.mjs
!*.scss
!*.ts
package-lock.json

View file

@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]
### Fixed
- Removed unnecessary sleep function
## [1.1.0] - 2025-03-19
### Changed

View file

@ -26,7 +26,6 @@
import { PluginSettingTab, Setting } from "obsidian";
import { CommandLineContext } from "./command";
import CommandLinePlugin from "./main";
import * as util from "./util";
const RELOAD_DELAY = 500;
@ -62,7 +61,7 @@ export class CommandLineSettingsTab extends PluginSettingTab {
.onChange(async (value) => {
this.plugin.settings.highlight = value;
await this.plugin.saveSettings();
await util.sleep(RELOAD_DELAY).then(() => {
await sleep(RELOAD_DELAY).then(() => {
location.reload();
});
});

View file

@ -44,10 +44,6 @@ export function mapTail<T>(array: T[], callbackFn: (thisArg: T) => T): T[] {
}, [] as T[]);
}
export function sleep(delay: number): Promise<void> {
return new Promise((resolve) => setTimeout(resolve, delay));
}
export function waitForGlobal(name: string, delay = 100): Promise<void> {
return new Promise((resolve) => {
(function resolver() {