Add crisp chat, disable analytics locally, fix date bug on calendar

This commit is contained in:
Rotimi Best
2021-11-10 16:20:17 +02:00
parent d1f49f5232
commit aef491da32
4 changed files with 17 additions and 5 deletions
+7 -1
View File
@@ -110,6 +110,12 @@
}
onMount(() => {
// Disable GA on localhost
if (config && !config.isProd) {
console.log('disable GA');
window['ga-disable-G-C7WBN0S06R'] = true;
}
handleResize();
const _isMvpUser = localStorage.getItem('mvp');
@@ -127,7 +133,7 @@
const { data: authListener } = supabase.auth.onAuthStateChange(
(event, session) => {
if (config.isDev) {
if (config.isProd) {
handleAuthChange(event, session);
}
console.log(`event`, event);
+5 -3
View File
@@ -25,7 +25,7 @@
let store;
let calendar: HTMLElement | null = null;
let lessonsByMonth: LessonsByMonthIndexType = {};
let prevSelectedDate: string = new Date().toDateString();
let prevSelectedDate: string = new Date().toUTCString();
let selectedDateLessonData: UserLessonDataType[] | [] = [];
const addDotsToCalendar = (currentMonthIndexInRenderedMonth: number) =>
@@ -85,9 +85,11 @@
}
function getDataOfSelectedDate(
selectedDate: string
_selectedDate: string
): UserLessonDataType[] | [] {
if (!selectedDate) return [];
if (!_selectedDate) return [];
const selectedDate = new Date(_selectedDate).toUTCString();
const monthIndex = new Date(selectedDate).getMonth();
const dateIndex = new Date(selectedDate).getDate();