fix: properties should not be usable when no note is open

This commit is contained in:
thecodrr
2020-12-31 16:07:37 +05:00
parent 08f2349b81
commit d48d909ce3

View File

@@ -77,10 +77,27 @@ function Toolbar(props) {
title: "Properties",
icon: Icon.Properties,
enabled: true,
onClick: toggleProperties,
onClick: () => {
if (!sessionId) {
showToast(
"error",
"Please start writing a note to use properties."
);
return;
}
toggleProperties();
},
},
],
[quill, redoable, undoable, toggleFocusMode, toggleProperties, isFocusMode]
[
quill,
redoable,
undoable,
toggleFocusMode,
toggleProperties,
isFocusMode,
sessionId,
]
);
return (