Skip to content

Commit

Permalink
- Modified load timeout handlers to use async functions
Browse files Browse the repository at this point in the history
- Ensured proper async handling of load method in global environment initialization
- Maintained existing timeout logic while improving asynchronous execution
  • Loading branch information
brianpetro committed Feb 22, 2025
1 parent b38dfe8 commit 067f423
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions smart-environment/smart_env.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ export class SmartEnv {
this.state = 'init';
this._components = {};
this.collections = {};
this.load_timeout = setTimeout(() => {
this.load();
this.load_timeout = setTimeout(async () => {
await this.load();
}, 5000);
}
/**
Expand Down Expand Up @@ -159,8 +159,8 @@ export class SmartEnv {
await SmartSettings.create(this.global_env);
}
clearTimeout(this.global_env.load_timeout);
this.global_env.load_timeout = setTimeout(() => {
this.global_env.load();
this.global_env.load_timeout = setTimeout(async () => {
await this.global_env.load();
}, 5000);
return this.global_env;
}
Expand Down

0 comments on commit 067f423

Please sign in to comment.