blob: 632bc69800619717c4e9b19407d98a99d599f3bd [file] [log] [blame]
Adrià Vilanova Martínez46773172024-01-10 21:44:22 +01001import {getOptions} from '../common/optionsUtils.js';
2
3export async function setUpRedirectIfEnabled(options = null) {
4 if (options === null) options = await getOptions(['redirect']);
5
6 if (options.redirect) {
7 setUpRedirect();
8 }
9}
10
11function setUpRedirect() {
12 window.TWPTRedirectHash = window.location.hash;
13 // We're preloading the redirect option so we can redirect faster in
14 // publicThread.js without having to retrieve the options again.
15 window.TWPTShouldRedirect = true;
16}