Continuing the discussion from Gated Topics in Category:
I was trying to modify the gated component to redirect the user to a specific page instead of showing a gate
1
I tried DiscourseURL.routeTo('/t/table-builder-test-2/1667')
on theme creator, it works but takes a while and throws errors on loading, although the page is successfully loaded.
2
I also tried with setDefaultHomepage('/t/table-builder-test-2/1667');
and
const container = Discourse.__container__;
const router = container.lookup("router:main");
let topicId = router.currentRoute.parent.params.id
PreloadStore.remove(`topic/${topicId}`);
It only redirects after the gated page is loaded then click on the back button.
3
location.href = '/t/table-builder-test-2/1667'
It works but the gated pages also loaded for a few secs, unlike 1 do it smoothly.
What is the best way to achieve this?