Minor fixes for reactivity issues and some updates
This commit is contained in:
parent
f53542c45b
commit
a9ce6e9cc0
|
@ -3,6 +3,9 @@ export default function positionDropdown(
|
|||
{ anchor, align, maxWidth, useAnchorWidth, showTip }
|
||||
) {
|
||||
const update = () => {
|
||||
if (!anchor) {
|
||||
return
|
||||
}
|
||||
const anchorBounds = anchor.getBoundingClientRect()
|
||||
const elementBounds = element.getBoundingClientRect()
|
||||
let styles = {
|
||||
|
@ -66,7 +69,9 @@ export default function positionDropdown(
|
|||
const resizeObserver = new ResizeObserver(entries => {
|
||||
entries.forEach(update)
|
||||
})
|
||||
if (anchor) {
|
||||
resizeObserver.observe(anchor)
|
||||
}
|
||||
resizeObserver.observe(element)
|
||||
resizeObserver.observe(document.body)
|
||||
|
||||
|
|
|
@ -16,6 +16,9 @@
|
|||
$: tourStepKey = $store.tourStepKey
|
||||
|
||||
const initTour = targetKey => {
|
||||
if (!targetKey) {
|
||||
return
|
||||
}
|
||||
tourSteps = [...TOURS[targetKey]]
|
||||
tourStepIdx = 0
|
||||
tourStep = { ...tourSteps[tourStepIdx] }
|
||||
|
@ -24,6 +27,9 @@
|
|||
$: initTour(tourKey)
|
||||
|
||||
const updateTourStep = targetStepKey => {
|
||||
if (!tourSteps?.length) {
|
||||
return
|
||||
}
|
||||
tourStepIdx = getCurrentStepIdx(tourSteps, targetStepKey)
|
||||
lastStep = tourStepIdx + 1 == tourSteps.length
|
||||
tourStep = { ...tourSteps[tourStepIdx] }
|
||||
|
@ -33,6 +39,9 @@
|
|||
$: updateTourStep(tourStepKey)
|
||||
|
||||
const showPopover = (tourStep, tourNodes, popover) => {
|
||||
if (!tourStep) {
|
||||
return
|
||||
}
|
||||
popoverAnchor = tourNodes[tourStep.id]
|
||||
popover?.show()
|
||||
}
|
||||
|
|
|
@ -20,7 +20,9 @@
|
|||
ready = true
|
||||
})
|
||||
onDestroy(() => {
|
||||
if (handler) {
|
||||
handler.destroy()
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
|
|
|
@ -72,11 +72,14 @@ const getTours = () => {
|
|||
onboardedAt: new Date().toISOString(),
|
||||
})
|
||||
|
||||
// Update the cached user
|
||||
await auth.getSelf()
|
||||
|
||||
store.update(state => ({
|
||||
...state,
|
||||
tourNodes: null,
|
||||
tourKey: null,
|
||||
tourKeyStep: null,
|
||||
tourNodes: undefined,
|
||||
tourKey: undefined,
|
||||
tourKeyStep: undefined,
|
||||
onboarding: false,
|
||||
}))
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue