From 64f9a27045724c5ad40c9d2cb0ee4f3a9f6f8c13 Mon Sep 17 00:00:00 2001 From: Luna Godier Date: Mon, 19 Dec 2022 19:57:00 +0100 Subject: [PATCH] test: added logs to debug player view --- src/components/App.tsx | 5 +++++ src/components/Excalidraw.tsx | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/src/components/App.tsx b/src/components/App.tsx index fcd5228d..b50b1ec4 100644 --- a/src/components/App.tsx +++ b/src/components/App.tsx @@ -1,3 +1,4 @@ +/* eslint-disable no-console */ import { RecordOf } from 'immutable'; import React, { FC, ReactElement, useContext, useEffect } from 'react'; @@ -27,8 +28,12 @@ const App: FC = () => { const renderContent = (): ReactElement => { switch (context.get('context')) { case Context.BUILDER: + console.log('rendering for builder'); + return ; case Context.ANALYTICS: + return ; case Context.PLAYER: + console.log('rendering for player'); return ; default: return ; diff --git a/src/components/Excalidraw.tsx b/src/components/Excalidraw.tsx index ab03e82a..96daa4e4 100644 --- a/src/components/Excalidraw.tsx +++ b/src/components/Excalidraw.tsx @@ -1,3 +1,4 @@ +/* eslint-disable no-console */ import { debounce } from 'lodash'; import React, { ReactElement, useRef } from 'react'; @@ -50,6 +51,7 @@ const GetView = (prop: { appData: AppData }): ReactElement => { elements: readonly ExcalidrawElement[], state: AppState, ): void { + console.log('handling changes'); debouncedPatch(elements, state); } @@ -92,6 +94,7 @@ const LoadView = (): ReactElement => { // get if empty send empty and create else send new vals const appData = appDataArray.find(({ type }) => type === 'session'); if (!appData) { + console.log('posting app data'); postAppData({ data: { elements: [], @@ -103,6 +106,7 @@ const LoadView = (): ReactElement => { type: APP_DATA_TYPES.SESSION_TYPE, visibility: APP_DATA_VISIBILITY.MEMBER, }); + console.log('stopped here in Load View'); return ; } return ;