From 7c104eaa3284afa7878d2464ae19890f8393b110 Mon Sep 17 00:00:00 2001 From: yunusemredilber Date: Thu, 12 Jan 2023 17:56:26 +0100 Subject: [PATCH 1/2] feat: simplify render async fragment function --- src/core.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/core.ts b/src/core.ts index f656ec6..c82b0a4 100644 --- a/src/core.ts +++ b/src/core.ts @@ -326,11 +326,12 @@ export class Core extends Module { }); } - static renderAsyncFragment(fragmentName: string, gatewayName?: string) { + static renderAsyncFragment(fragmentName: string) { const fragment = this.__pageConfiguration.fragments.find( _fragment => _fragment.name === fragmentName && - ((_fragment.gateway && gatewayName) ? _fragment.gateway === gatewayName : true) + ((typeof _fragment.attributes.if === "string") ? _fragment.attributes.if === "true" : true) ); + if (fragment) { const selector = this.getFragmentContainerSelector(fragment, "main"); const fragmentContainer = window.document.querySelector(selector); From 1b35a49377482bbf0f52f1dc04a5f028afc4b112 Mon Sep 17 00:00:00 2001 From: yunusemredilber Date: Thu, 12 Jan 2023 17:57:19 +0100 Subject: [PATCH 2/2] chore: update package version --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 28e4e3d..a8f2415 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@puzzle-js/client-lib", "main": "dist/index.js", - "version": "1.8.0", + "version": "1.8.1", "author": "", "license": "MIT", "repository": {