Gated Topics in Category からの議論の続きです。
ゲートを表示する代わりに、ユーザーを指定されたページにリダイレクトするようにゲートコンポーネントを変更しようとしていました。
1
テーマクリエーターで DiscourseURL.routeTo('/t/table-builder-test-2/1667') を試しました。これは機能しますが、時間がかかり、ページは正常に読み込まれますが、読み込み中にエラーが発生します。
2
setDefaultHomepage('/t/table-builder-test-2/1667'); と
const container = Discourse.__container__;
const router = container.lookup("router:main");
let topicId = router.currentRoute.parent.params.id
PreloadStore.remove(`topic/${topicId}`);
でも試しました。ゲートページが読み込まれてから戻るボタンをクリックした後にのみリダイレクトされます。
3
location.href = '/t/table-builder-test-2/1667'
これは機能しますが、ゲートページも数秒間読み込まれ、1 のようにスムーズではありません。
これを達成するための最良の方法は何ですか?
