← All changes
|
app/Services/Integrations/FluentCommunity/FluentCommunityIntegration.php
+6
-14
2.3.2
→
2.4.5
View file →
| @@ -2,13 +2,10 @@ | ||
| 2 | 2 | |
| 3 | 3 | namespace FluentSupport\App\Services\Integrations\FluentCommunity; |
| 4 | 4 | |
| 5 | 5 | /** |
| 6 | - * FluentCommunityIntegration bootstraps the Fluent Support portal | |
| 7 | - * inside the FluentCommunity community portal. | |
| 8 | - * | |
| 9 | - * Activated only when FLUENT_COMMUNITY_PLUGIN_VERSION is defined and | |
| 10 | - * the portal destination is set to fluent_community. | |
| 6 | + * Renders the Fluent Support portal inside the FluentCommunity portal | |
| 7 | + * when the portal destination is set to fluent_community. | |
| 11 | 8 | */ |
| 12 | 9 | class FluentCommunityIntegration |
| 13 | 10 | { |
| 14 | 11 | public function boot() |
| @@ -16,21 +13,16 @@ | ||
| 16 | 13 | if (!$this->shouldUseCommunityPortal()) { |
| 17 | 14 | return; |
| 18 | 15 | } |
| 19 | 16 | |
| 20 | - // Register 'support' as a known FC route so FC's Vue router treats | |
| 21 | - // it as a valid path and does not fire the NotFound → all_feeds | |
| 22 | - // redirect chain on client-side navigation. | |
| 17 | + // Tell FC 'support' is a known route so it doesn't redirect to all_feeds. | |
| 23 | 18 | add_filter('fluent_community/app_route_paths', [$this, 'registerSupportRoute']); |
| 24 | 19 | |
| 25 | - // Handle the support route entirely in the SSR hook — mirrors the | |
| 26 | 20 | add_action('fluent_community/rendering_path_ssr_support', [$this, 'renderSupportPortal']); |
| 27 | 21 | |
| 28 | - // FC's Vue Router intercepts all portal-domain <a> clicks. Since /support | |
| 29 | - // is not a registered FC Vue route, the router falls through to NotFound | |
| 30 | - // which redirects to all_feeds. This beforeEach guard converts any SPA | |
| 31 | - // navigation to /support into a full page load, which then hits the SSR hook. | |
| 32 | - // Must run on ALL community portal pages, not just the support route. | |
| 22 | + // FC's Vue router has no /support route and would fall through to NotFound. | |
| 23 | + // Turn SPA navigation to /support into a full page load so the SSR hook runs. | |
| 24 | + // Needed on every portal page, not only the support route. | |
| 33 | 25 | add_action('fluent_community/portal_footer', [$this, 'outputRouterGuard'], 999); |
| 34 | 26 | } |
| 35 | 27 | |
| 36 | 28 | public function registerSupportRoute($paths) |