Skip to content

Commit

Permalink
Merge pull request #4 from flotiq/fix/incorrect-timeout-on-detach
Browse files Browse the repository at this point in the history
Fix incorrect timeout on detach event
  • Loading branch information
rgembalik authored Jun 19, 2024
2 parents a993a43 + 3867ed4 commit ed32050
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
12 changes: 5 additions & 7 deletions src/plugin-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,11 @@ export const addElementToCache = (element, root, key) => {
root,
};

setTimeout(
() =>
element.addEventListener("flotiq.detached", () => {
delete appRoots[key];
}),
50
);
element.addEventListener("flotiq.detached", () => {
setTimeout(() => {
return delete appRoots[key];
}, 50);
});
};

export const getCachedElement = (key) => {
Expand Down
2 changes: 1 addition & 1 deletion src/plugin-manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"id": "flotiq.react-template",
"name": "React Template Plugin",
"version": "0.1.1",
"version": "0.1.2",
"description": "A react-based example of Flotiq plugin. This will render a shiny title instead of regular title fields",
"repository": "https://github.com/flotiq/flotiq-ui-plugins-templates-react",
"url": "https://localhost:3050/static/js/bundle.js"
Expand Down

0 comments on commit ed32050

Please sign in to comment.