Skip to content

Commit

Permalink
fix: remove unused vars and logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Palanikannan1437 committed Sep 24, 2024
1 parent 2c2dd62 commit cf69d96
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
8 changes: 2 additions & 6 deletions web/core/components/pages/editor/editor-body.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useCallback, useEffect, useMemo, useState } from "react";
import { useCallback, useMemo, useState } from "react";
import { observer } from "mobx-react";
import { useParams } from "next/navigation";
// document-editor
Expand All @@ -7,7 +7,6 @@ import {
CollaborativeDocumentReadOnlyEditorWithRef,
EditorReadOnlyRefApi,
EditorRefApi,
IMarking,
TAIMenuProps,
TDisplayConfig,
TRealtimeConfig,
Expand Down Expand Up @@ -70,7 +69,7 @@ export const PageEditorBody: React.FC<Props> = observer((props) => {
project: { getProjectMemberIds },
} = useMember();
// derived values
const workspaceId = workspaceSlug ? getWorkspaceBySlug(workspaceSlug.toString())?.id ?? "" : "";
const workspaceId = workspaceSlug ? (getWorkspaceBySlug(workspaceSlug.toString())?.id ?? "") : "";
const pageId = page?.id;
const pageTitle = page?.name ?? "";
const { isContentEditable, updateTitle, setIsSubmitting } = page;
Expand Down Expand Up @@ -109,7 +108,6 @@ export const PageEditorBody: React.FC<Props> = observer((props) => {
}, []);

const handleServerSynced = useCallback(() => {
console.log("handleServerSynced called");
setIsSynced(true);
}, []);

Expand All @@ -134,8 +132,6 @@ export const PageEditorBody: React.FC<Props> = observer((props) => {
[projectId, workspaceSlug]
);

console.log("isSynced", isSynced);

if (pageId === undefined) return <PageContentLoader />;

return (
Expand Down
4 changes: 1 addition & 3 deletions web/core/components/pages/editor/header/options-dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ export const PageOptionsDropdown: React.FC<Props> = observer((props) => {
setLocalAction(null);
return;
}
console.log("message", message.payload);

switch (message.payload) {
case "locked":
Expand Down Expand Up @@ -89,7 +88,6 @@ export const PageOptionsDropdown: React.FC<Props> = observer((props) => {
.then(() => {
if (isLocal) {
setLocalAction("archived");
console.log("archivinggg");
}
})
.catch(() => {
Expand All @@ -101,7 +99,7 @@ export const PageOptionsDropdown: React.FC<Props> = observer((props) => {
});
};

// Add this useEffect hook to watch for changes in localAction
// watch for changes in localAction
useEffect(() => {
if (localAction === "archived") {
editorRef?.emitRealTimeUpdate("archive");
Expand Down

0 comments on commit cf69d96

Please sign in to comment.