Skip to content

Commit 7d2bc2b

Browse files
committed
render arrow in slow devices
1 parent e777de7 commit 7d2bc2b

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

src/App.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<template>
22
<div id="app" :class="{'value-masked': amountsHidden}">
3-
<!-- (?) This could be moved to Groundfloor.vue -->
43
<transition v-if="showTour" name="delay">
54
<Tour/>
65
</transition>

src/components/Tour.vue

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
{{ tour.steps[tour.currentStep].button.text }}
9393
</button>
9494
<button
95-
v-else-if="isLargeScreen && !disableNextStep && !isLoading"
95+
v-else-if="isLargeScreen && !isLoading"
9696
class="right"
9797
@click="goToNextStep()"
9898
tabindex="0"
@@ -600,14 +600,18 @@ export default defineComponent({
600600
<path d="M3.3 7.2A4 4 0 0 1 0 9h18a4 4 0 0 1-3.3-1.8L10.3.8c-.6-.9-1.9-.9-2.5 0L3.3 7.2z"/>
601601
</svg>`;
602602
function _changeArrowAppearance(stepIndex: TourStepIndex) {
603-
setTimeout(() => {
604-
const arrow = $(
605-
`[data-step="${stepIndex}"] [data-popper-arrow]`) as HTMLDivElement;
606-
if (!arrow) return;
607-
arrow.innerHTML = arrowSvg;
608-
arrow.style.visibility = 'initial';
609-
arrow.style.width = '2rem';
610-
}, 100);
603+
// It has been detected that some slower devices are not able to render the arrow
604+
// in time, therefore we need to wait until the arrow is rendered and try a few times
605+
Array.from({ length: 10 }).forEach((_, i) => {
606+
setTimeout(() => {
607+
const arrow = $(
608+
`[data-step="${stepIndex}"] [data-popper-arrow]`) as HTMLDivElement;
609+
if (!arrow) return;
610+
arrow.innerHTML = arrowSvg;
611+
arrow.style.visibility = 'initial';
612+
arrow.style.width = '2rem';
613+
}, 100 * (i + 1));
614+
});
611615
}
612616
613617
return {

src/lib/tour/onboarding/index.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@ export function getOnboardingTourSteps({ root }: SetupContext, screenTypes: Scre
2929
// Returns the length of the transaction list for the current active account and active address
3030
// Easier to access component transaction-list which has already been mounted and has the list
3131
// of valid transactions for the current active account and active address
32-
const txsLen = computed<number>(() => {
33-
const txs = (searchComponentByName(root, 'transactions-list') as any).txsForActiveAddress || [];
34-
return txs.length || 0;
35-
});
32+
const txsLen = computed<number>(() => (searchComponentByName(root, 'transactions-list') as any).txCount || 0);
3633

3734
const { state, activeAccountInfo } = useAccountStore();
3835
const { startedFrom } = (state.tour as { startedFrom: ITourOrigin });

0 commit comments

Comments
 (0)