mattmilburn / strapi-plugin-preview-button

A plugin for Strapi CMS that adds a preview button and live view button to the content manager edit view.
MIT License
100 stars 35 forks source link

Preview button in list is not working after logging in #68

Closed not-vainglorious closed 10 months ago

not-vainglorious commented 1 year ago

When you first time entering admin page before logging in request to admin API to get config is sent but because it has 'admin::isAuthenticatedAdmin' it crashes and so we are not getting any data (because on login page we're actually still not admin). That's why when you enter list page pluginConfig is empty and additional column is not showing.

mattmilburn commented 1 year ago

Hi @not-vainglorious Thanks for pointing this out. I will try to include this fix in an upcoming release 👍🏻

mattmilburn commented 1 year ago

I was planning on including this update in the latest release v1.0.1 from today, but I think I am hacking Strapi a little much by using API requests within the bootstrap method of a plugin. Currently I can't think of another way to provide the plugin config directly to the content manager hook, which cannot be async or use other hooks as far as I can tell.

I'll need to think on this and come back to it for now.

mattmilburn commented 1 year ago

Hi @not-vainglorious This plugin has now been upgraded to version 2.0.0 with breaking changes to the configuration and a lot of improvements behind the scenes.

I believe this upgrade should resolve the issues you are having with the error that occurs after logging in. Please let me know how it goes for you and see the migration guide before upgrading.