Only start the next tour if the selected tour is not the introduction.
This commit is contained in:
parent
395ce2fb62
commit
771e69c631
|
@ -17,12 +17,20 @@ async function main(): Promise<void> {
|
||||||
const prefix = "tildes-shepherd-tour=";
|
const prefix = "tildes-shepherd-tour=";
|
||||||
const startsWithPrefix = anchor.startsWith(prefix);
|
const startsWithPrefix = anchor.startsWith(prefix);
|
||||||
|
|
||||||
|
// Get the tour ID from the anchor by removing the prefix.
|
||||||
|
const anchorTourId = anchor.slice(prefix.length);
|
||||||
|
|
||||||
// Automatically start the introduction tour if the person hasn't already
|
// Automatically start the introduction tour if the person hasn't already
|
||||||
// been through it and only when on the Tildes homepage.
|
// been through it and only when on the Tildes homepage.
|
||||||
if (!introductionUnderstood.value && window.location.pathname === "/") {
|
if (!introductionUnderstood.value && window.location.pathname === "/") {
|
||||||
// If a different tour is selected but the introduction hasn't happened yet,
|
// If a different tour is selected but the introduction hasn't happened yet,
|
||||||
// then the main function will be rerun once this tour finishes.
|
// then the main function will be rerun once this tour finishes.
|
||||||
startTour("introduction", introductionSteps, [], startsWithPrefix);
|
startTour(
|
||||||
|
"introduction",
|
||||||
|
introductionSteps,
|
||||||
|
[],
|
||||||
|
startsWithPrefix && anchorTourId !== "introduction",
|
||||||
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -30,9 +38,6 @@ async function main(): Promise<void> {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the tour ID from the anchor by removing the prefix.
|
|
||||||
const anchorTourId = anchor.slice(prefix.length);
|
|
||||||
|
|
||||||
// Then run through all of the tours we have and start the first match for the
|
// Then run through all of the tours we have and start the first match for the
|
||||||
// ID.
|
// ID.
|
||||||
for (const [id, steps, eventHandlers] of tourIdsAndSteps) {
|
for (const [id, steps, eventHandlers] of tourIdsAndSteps) {
|
||||||
|
|
Loading…
Reference in New Issue