more tracking; hide arb from welcome splash
This commit is contained in:
@@ -12,9 +12,11 @@ const props = defineProps({
|
||||
name: {type: String, required: true},
|
||||
when: {type: Boolean, default: true}, // optional conditional for when to show
|
||||
after: {type: String, default: null}, // set to the name of another hint that must happen before this hint, to chain hints into a tutorial.
|
||||
onComplete: {type: Function, default: null},
|
||||
})
|
||||
|
||||
const forceClose = ref(false)
|
||||
const shown = ref(false)
|
||||
|
||||
const show = computed({
|
||||
get() {
|
||||
@@ -23,11 +25,13 @@ const show = computed({
|
||||
const afterOk = props.after === null || prefs.hints[props.after];
|
||||
const result = !forceClose.value && !shownBefore && whenOk && afterOk
|
||||
// console.log(`show ${props.name}? ${result} <=`, !forceClose.value, whenOk, afterOk, prefs.hints)
|
||||
if (result)
|
||||
if (result) {
|
||||
shown.value = true
|
||||
prefs.hints[props.name] = true
|
||||
}
|
||||
return result
|
||||
},
|
||||
set(v) { if(!v) forceClose.value=true; }
|
||||
set(v) { if(!v) { forceClose.value=true; if (shown.value && props.onComplete) props.onComplete(); } }
|
||||
})
|
||||
</script>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user