Issue #1854Opened March 4, 2019by NicoEngler1 reactions

Asset manager empty on second open

Question

Hi, I am trying to build a plugin which sets up the asset manager as a SVG repository. If the user selects a SVG, the asset manager opens. Next, the user can replace the current SVG with the one selected. Most of the code I am using is found on: https://grapesjs.com/docs/modules/Assets.html#customization

Demo: https://jsfiddle.net/9vgf573s/12/

Problem:

  1. Click the SVG, (asset manager opens)
  2. Close the asset manager
  3. Click the SVG again -> asset manager is empty

What am I doing wrong?

PS: Replacing does not seem to work either but I have not really looked into it because the current problem makes it annoying to debug.

Cheers

Answers (3)

noogenMarch 4, 20191 reactions

Line 28, you're filtering it twice since you're already doing it on line 23? am.render(am.getAll().filter(assets));

Works when I'm doing it like so: am.render(assets);

NicoEnglerMarch 4, 20190 reactions

Awesome, thanks for the catch! @noogen

lock[bot]March 10, 20200 reactions

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Related Questions and Answers

Continue research with similar issue discussions.

Paid Plugins That Match This Issue

Curated by issue keywords and label relevance to help you ship faster.

View all plugins

Loading paid plugin recommendations...

Browse Plugin Categories

Jump directly to plugin category pages on the marketplace.