mirror of
https://github.com/sstallion/obsidian-command-line.git
synced 2026-07-22 05:42:07 +00:00
Remove unnecessary sleep function (#9)
This commit is contained in:
parent
1a8aefdf7f
commit
6d9da16303
4 changed files with 6 additions and 7 deletions
|
|
@ -1,6 +1,6 @@
|
|||
*.*
|
||||
!*.css
|
||||
!*.json
|
||||
!*.mjs
|
||||
!*.scss
|
||||
!*.ts
|
||||
package-lock.json
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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();
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Reference in a new issue