beyondcode / invoker-er-diagram-plugin

Generate ER Diagrams in Invoker
16 stars 2 forks source link

Prevent multiple loadings of the graph #4

Open AndreSchwarzer opened 2 years ago

AndreSchwarzer commented 2 years ago

Closes #3

Bug in the current version 1.0.1

  1. Open Invoker
  2. Go to plugins
  3. Install "ER Digram Plugin"
  4. Restart Invoker
  5. Open Laravel project
  6. Click the "ER Diagram Plugin" icon in the left project's nav
  7. See relations rendered twice

before_default

You can worsen the state

  1. Click (after all the steps above) on a different menu option in the left project's nav
  2. Click again the "ER Diagram Plugin" Icon

Now each relation is rendered three times. Repeat this for additional rendering to your liking 😅

before_repetition

Solution

IMHO: The call to render the graph in the mount method seems not to be needed at all.

After removing it, none of the steps above are producing error states for me anymore.

after

Disclaimer

JS is not my daily business. If there are internal components depending on the mount method maybe keep the mount method and remove the activated method then. 🤷🏻 😁

AndreSchwarzer commented 2 years ago

For ease of testing

The fixed version of this PR: plugin-1.0.1.zip

AndreSchwarzer commented 2 years ago

Feel free to close, @mpociot @sschlein, if this plug-in is no longer maintained.