Skip to content

A fully open source & end-to-end encrypted note taking alternative to Evernote.

web: allow non-pro users to customize sidebar

Abdullah Attacc239d927c28
diff --git a/apps/web/src/components/navigation-menu/index.tsx b/apps/web/src/components/navigation-menu/index.tsx
index 8d99cf423..3701298e1 100644
--- a/apps/web/src/components/navigation-menu/index.tsx
+++ b/apps/web/src/components/navigation-menu/index.tsx
@@ -527,11 +527,14 @@ function ReorderableList<T extends { id: string }>(
<DndContext
sensors={sensors}
collisionDetection={closestCenter}
+ cancelDrop={() => {
+ // if (!isUserPremium()) {
+ // showToast("error", "You need to be Pro to customize the sidebar.");
+ // return true;
+ // }
+ return false;
+ }}
onDragStart={(event) => {
- if (!isUserPremium()) {
- showToast("error", "You need to be Pro to customize the sidebar.");
- return;
- }
setActiveItem(orderedItems.find((i) => i.id === event.active.id));
}}
onDragEnd={(event) => {
diff --git a/apps/web/src/dialogs/settings/components/customize-toolbar.tsx b/apps/web/src/dialogs/settings/components/customize-toolbar.tsx
index f77e9fbc0..fae9c83d0 100644
--- a/apps/web/src/dialogs/settings/components/customize-toolbar.tsx
+++ b/apps/web/src/dialogs/settings/components/customize-toolbar.tsx
@@ -162,12 +162,14 @@ export function CustomizeToolbar() {
<DndContext
sensors={sensors}
collisionDetection={closestCenter}
- onDragStart={(event) => {
+ cancelDrop={() => {
if (!isUserPremium()) {
- showToast("info", "You need to be Pro to customize the toolbar.");
- return;
+ showToast("error", "You need to be Pro to customize the toolbar.");
+ return true;
}
-
+ return false;
+ }}
+ onDragStart={(event) => {
if (currentPreset.id !== "custom") {
setCurrentPreset((c) => ({
...getPreset("custom"),