Skip to content

Commit 8aabffd

Browse files
committed
fix race condition in UserTimezoneMismatchModal
1 parent b373427 commit 8aabffd

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

resources/js/Components/Common/User/UserTimezoneMismatchModal.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,10 @@ onMounted(() => {
2727
timezone.value = Intl.DateTimeFormat().resolvedOptions().timeZone;
2828
userTimezone.value = getUserTimezone();
2929
30+
const now = getDayJsInstance()();
31+
3032
if (
31-
getDayJsInstance()().tz(timezone.value).format() !==
32-
getDayJsInstance()().tz(userTimezone.value).format() &&
33+
now.tz(timezone.value).format() !== now.tz(userTimezone.value).format() &&
3334
!hideTimezoneMismatchModal.value
3435
) {
3536
show.value = true;

0 commit comments

Comments
 (0)