diff --git a/apps/web/src/components/menu/colors.js b/apps/web/src/components/menu/colors.js index 784e1622d..d23198a39 100644 --- a/apps/web/src/components/menu/colors.js +++ b/apps/web/src/components/menu/colors.js @@ -7,7 +7,7 @@ import { Flex } from "rebass"; import useMobile from "../../utils/use-mobile"; function Colors(props) { - const { id, colors } = props.data; + const { id, color } = props.data; const setColor = useStore((store) => store.setColor); const isMobile = useMobile(); return ( @@ -27,7 +27,7 @@ function Colors(props) { strokeWidth={0} data-test-id={`menuitem-colors-${label}`} /> - {colors.includes(label) && ( + {color === label && ( store.session.colors); + const color = useStore((store) => store.session.color); const toggleLocked = useStore((store) => store.toggleLocked); const tags = useStore((store) => store.session.tags); const sessionId = useStore((store) => store.session.id); @@ -178,7 +178,7 @@ function Properties() { {toTitleCase(label)} - {colors.includes(label) && ( + {color === label && ( { let note = db.notes.note(id); if (!note) return; - const shouldUncolor = note.data.colors.indexOf(color) > -1; - for (var c of note.data.colors) { - await note.uncolor(c); - } + const shouldUncolor = note.data.color === color; if (!shouldUncolor) await db.notes.note(id).color(color); appStore.refreshColors(); - if (!this._syncEditor(note.id, "colors", db.notes.note(id).data.colors)) { + if (!this._syncEditor(note.id, "color", db.notes.note(id).data.color)) { this.refresh(); } }; diff --git a/apps/web/yarn.lock b/apps/web/yarn.lock index b73eaf497..22fe1a5ad 100644 --- a/apps/web/yarn.lock +++ b/apps/web/yarn.lock @@ -8962,9 +8962,21 @@ normalize-url@^3.0.0, normalize-url@^3.0.1: resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-3.3.0.tgz#b2e1c4dc4f7c6d57743df733a4f5978d18650559" integrity sha512-U+JJi7duF1o+u2pynbp2zXDW2/PADgC30f0GsHZtRh+HOcXHnw137TrNlyxxRvWW5fjKd3bcLHPxofWuCjaeZg== +notes-core@../notes-core/: + version "4.0.0" + dependencies: + fast-sort "^2.0.1" + fuzzysearch "^1.0.3" + jshashes "^1.0.8" + no-internet "^1.5.2" + qclone "^1.0.4" + quill-delta-to-html "^0.12.0" + quill-delta-to-markdown "https://github.com/streetwriters/quill-delta-to-markdown" + transfun "^1.0.2" + "notes-core@git+ssh://git@github.com:streetwriters/notesnook-core.git": version "4.0.0" - resolved "git+ssh://git@github.com:streetwriters/notesnook-core.git#202bfdcc24c347455857c0a8b5e804df68a8b9e2" + resolved "git+ssh://git@github.com:streetwriters/notesnook-core.git#1692099ea401ec66ec6ff7d445c730915eb8b800" dependencies: fast-sort "^2.0.1" fuzzysearch "^1.0.3"