mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-07-10 04:21:21 +02:00
web: fix properties panel in focus mode (#9917)
* allow properties panel to open/close when app is in focus mode Signed-off-by: 01zulfi <85733202+01zulfi@users.noreply.github.com>
This commit is contained in:
@@ -27,7 +27,6 @@ import {
|
||||
Lock,
|
||||
NewTab,
|
||||
Note,
|
||||
NoteAdd,
|
||||
NoteRemove,
|
||||
Pin,
|
||||
Plus,
|
||||
@@ -98,7 +97,6 @@ type ToolButton = {
|
||||
export function EditorActionBar() {
|
||||
const { isMaximized, isFullscreen, hasNativeWindowControls } =
|
||||
useWindowControls();
|
||||
const isFocusMode = useAppStore((store) => store.isFocusMode);
|
||||
const activeTab = useEditorStore((store) => store.getActiveTab());
|
||||
const activeSession = useEditorStore((store) =>
|
||||
activeTab ? store.getSession(activeTab.sessionId) : undefined
|
||||
@@ -187,8 +185,7 @@ export function EditorActionBar() {
|
||||
activeSession &&
|
||||
activeSession.type !== "new" &&
|
||||
activeSession.type !== "locked" &&
|
||||
activeSession.type !== "conflicted" &&
|
||||
!isFocusMode,
|
||||
activeSession.type !== "conflicted",
|
||||
onClick: () => useEditorStore.getState().toggleProperties(),
|
||||
toggled: arePropertiesVisible
|
||||
},
|
||||
|
||||
@@ -41,7 +41,6 @@ import {
|
||||
DefaultEditorSession
|
||||
} from "../../stores/editor-store";
|
||||
import { db } from "../../common/db";
|
||||
import { useStore as useAppStore } from "../../stores/app-store";
|
||||
import { useStore as useAttachmentStore } from "../../stores/attachment-store";
|
||||
import { store as noteStore } from "../../stores/note-store";
|
||||
import Toggle from "./toggle";
|
||||
@@ -109,7 +108,6 @@ type EditorPropertiesProps = {
|
||||
};
|
||||
function EditorProperties(props: EditorPropertiesProps) {
|
||||
const toggleProperties = useEditorStore((store) => store.toggleProperties);
|
||||
const isFocusMode = useAppStore((store) => store.isFocusMode);
|
||||
const dateFormat = useSettingStore((store) => store.dateFormat);
|
||||
const timeFormat = useSettingStore((store) => store.timeFormat);
|
||||
const metadataItems = [
|
||||
@@ -140,7 +138,8 @@ function EditorProperties(props: EditorPropertiesProps) {
|
||||
"diff"
|
||||
])
|
||||
);
|
||||
if (isFocusMode || !session) return null;
|
||||
if (!session) return null;
|
||||
|
||||
return (
|
||||
<Flex
|
||||
sx={{
|
||||
|
||||
Reference in New Issue
Block a user