Commit 2b70db9c authored by John Chilton's avatar John Chilton
Browse files

Fixes to have deferred data tour work a bit better.

parent d3d51c27
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -86,6 +86,9 @@ export default {
        isLast() {
            return this.currentIndex === this.steps.length - 1;
        },
        hasBegun() {
            return this.currentIndex >= 1;
        },
    },
    beforeDestroy() {
        window.removeEventListener("keyup", this.handleKeyup);
@@ -105,12 +108,15 @@ export default {
            }
        },
        loginRequired(user) {
            return this.requirements.indexOf("logged_in") >= 0 && user.isAnonymous;
            return !this.hasBegun && this.requirements.indexOf("logged_in") >= 0 && user.isAnonymous;
        },
        adminRequired(user) {
            return this.requirements.indexOf("admin") >= 0 && !user.is_admin;
            return !this.hasBegun && this.requirements.indexOf("admin") >= 0 && !user.is_admin;
        },
        newHistoryRequired(history) {
            if (this.hasBegun) {
                return false;
            }
            const hasNewNistoryRequirement = this.requirements.indexOf("new_history") >= 0;
            if (!hasNewNistoryRequirement) {
                return false;
+1 −1
Original line number Diff line number Diff line
@@ -4,7 +4,7 @@ import { mountVueComponent } from "utils/mountVueComponent";
import Tour from "./Tour";

// delays and maximum number of attempts to wait for element
const attempts = 100;
const attempts = 200;
const delay = 200;

// return tour data