Skip to content

Commit

Permalink
Change component registration to async
Browse files Browse the repository at this point in the history
  • Loading branch information
ahmadnasriya committed Jul 14, 2024
1 parent bc3a457 commit 25f499a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/services/renderer/manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class RenderingManager {
readonly #_siteName: Record<string, any> = { default: null }
#_assetsBaseUrl = '/_assets/renderer';

#_helpers = {
readonly #_helpers = {
sendStylesheet: (data: { stylesheet: InternalStylesheetRecord | undefined, isCached: boolean, type: 'Page' | 'Component' }, res: HyperCloudResponse) => {
const { stylesheet, isCached, type } = data;
if (stylesheet) {
Expand Down
4 changes: 2 additions & 2 deletions src/services/renderer/managers/componentsManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ class ComponentsManager {
* Register your defined components so you can use them in your code
* @param paths A `PathLike` or an array of `PathLike` directories containing your components.
*/
register(paths: string | string[]) {
async register(paths: string | string[]) {
if (!Array.isArray(paths)) { paths = [paths] }
const errRes = { message: 'Invalid components\' paths detected. Read the error list', errors: [] as any[] }

// Validating input
for (const viewsPath of paths) {
const validity = helpers.checkPathAccessibility(viewsPath);
if (validity.valid) {
this.#_helpers.register(viewsPath);
await this.#_helpers.register(viewsPath);
continue;
}

Expand Down

0 comments on commit 25f499a

Please sign in to comment.