Skip to content

Commit

Permalink
Merge pull request #1651 from ajnart/fix-notebook-settings-overlapped
Browse files Browse the repository at this point in the history
  • Loading branch information
ajnart authored Nov 15, 2023
2 parents 57975f3 + 21dcde4 commit 228c512
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/widgets/notebook/NotebookEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ import StarterKit from '@tiptap/starter-kit';
import { useSession } from 'next-auth/react';
import { useTranslation } from 'next-i18next';
import { Dispatch, SetStateAction, useState } from 'react';
import { useEditModeStore } from '~/components/Dashboard/Views/useEditModeStore';
import { useConfigContext } from '~/config/provider';
import { useConfigStore } from '~/config/store';
import { api } from '~/utils/api';
Expand All @@ -62,9 +63,10 @@ import { INotebookWidget } from './NotebookWidgetTile';
export function Editor({ widget }: { widget: INotebookWidget }) {
const [content, setContent] = useState(widget.properties.content);
const [toSaveContent, setToSaveContent] = useState(content);
const isEditMode = useEditModeStore((x) => x.enabled);

const { data: sessionData } = useSession();
const enabled = !!sessionData?.user.isAdmin;
const enabled = !!sessionData?.user.isAdmin && !isEditMode;
const [isEditing, setIsEditing] = useState(false);

const { config, name: configName } = useConfigContext();
Expand Down

0 comments on commit 228c512

Please sign in to comment.