Add crisp chat, disable analytics locally, fix date bug on calendar
This commit is contained in:
@@ -110,6 +110,12 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
|
// Disable GA on localhost
|
||||||
|
if (config && !config.isProd) {
|
||||||
|
console.log('disable GA');
|
||||||
|
window['ga-disable-G-C7WBN0S06R'] = true;
|
||||||
|
}
|
||||||
|
|
||||||
handleResize();
|
handleResize();
|
||||||
|
|
||||||
const _isMvpUser = localStorage.getItem('mvp');
|
const _isMvpUser = localStorage.getItem('mvp');
|
||||||
@@ -127,7 +133,7 @@
|
|||||||
|
|
||||||
const { data: authListener } = supabase.auth.onAuthStateChange(
|
const { data: authListener } = supabase.auth.onAuthStateChange(
|
||||||
(event, session) => {
|
(event, session) => {
|
||||||
if (config.isDev) {
|
if (config.isProd) {
|
||||||
handleAuthChange(event, session);
|
handleAuthChange(event, session);
|
||||||
}
|
}
|
||||||
console.log(`event`, event);
|
console.log(`event`, event);
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
let store;
|
let store;
|
||||||
let calendar: HTMLElement | null = null;
|
let calendar: HTMLElement | null = null;
|
||||||
let lessonsByMonth: LessonsByMonthIndexType = {};
|
let lessonsByMonth: LessonsByMonthIndexType = {};
|
||||||
let prevSelectedDate: string = new Date().toDateString();
|
let prevSelectedDate: string = new Date().toUTCString();
|
||||||
let selectedDateLessonData: UserLessonDataType[] | [] = [];
|
let selectedDateLessonData: UserLessonDataType[] | [] = [];
|
||||||
|
|
||||||
const addDotsToCalendar = (currentMonthIndexInRenderedMonth: number) =>
|
const addDotsToCalendar = (currentMonthIndexInRenderedMonth: number) =>
|
||||||
@@ -85,9 +85,11 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getDataOfSelectedDate(
|
function getDataOfSelectedDate(
|
||||||
selectedDate: string
|
_selectedDate: string
|
||||||
): UserLessonDataType[] | [] {
|
): UserLessonDataType[] | [] {
|
||||||
if (!selectedDate) return [];
|
if (!_selectedDate) return [];
|
||||||
|
|
||||||
|
const selectedDate = new Date(_selectedDate).toUTCString();
|
||||||
|
|
||||||
const monthIndex = new Date(selectedDate).getMonth();
|
const monthIndex = new Date(selectedDate).getMonth();
|
||||||
const dateIndex = new Date(selectedDate).getDate();
|
const dateIndex = new Date(selectedDate).getDate();
|
||||||
|
|||||||
+1
-1
@@ -11,7 +11,7 @@ import { getSupabase } from './utils/functions/supabase';
|
|||||||
dotenv.config();
|
dotenv.config();
|
||||||
|
|
||||||
const config = {
|
const config = {
|
||||||
isDev: process.env.NODE_ENV === 'development',
|
isProd: process.env.NODE_ENV !== 'development',
|
||||||
telegramToken: process.env.SVELTE_APP_TELEGRAM_API_TOKEN,
|
telegramToken: process.env.SVELTE_APP_TELEGRAM_API_TOKEN,
|
||||||
supabaseConfig: {
|
supabaseConfig: {
|
||||||
bucketPath:
|
bucketPath:
|
||||||
|
|||||||
@@ -23,6 +23,10 @@
|
|||||||
gtag('config', 'G-C7WBN0S06R');
|
gtag('config', 'G-C7WBN0S06R');
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<!--Crisp Chat -->
|
||||||
|
<script
|
||||||
|
type="text/javascript">window.$crisp = []; window.CRISP_WEBSITE_ID = "2158dbf9-90d4-4e50-b962-e1d8a1a6deb7"; (function () { d = document; s = d.createElement("script"); s.src = "https://client.crisp.chat/l.js"; s.async = 1; d.getElementsByTagName("head")[0].appendChild(s); })();</script>
|
||||||
|
|
||||||
<!-- Sapper creates a <script> tag containing `src/client.js`
|
<!-- Sapper creates a <script> tag containing `src/client.js`
|
||||||
and anything else it needs to hydrate the app and
|
and anything else it needs to hydrate the app and
|
||||||
initialise the router -->
|
initialise the router -->
|
||||||
|
|||||||
Reference in New Issue
Block a user