From 855442a2ff192ad8a8fa258ac15743c058f9caf1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89ric=20D?= <15271+edas@users.noreply.github.com> Date: Thu, 9 Jan 2020 13:23:36 +0100 Subject: [PATCH] Apply suggestions from code review Co-Authored-By: Quentin Valmori --- src/hooks/useNote.js | 4 ++-- src/lib/collab/channel.spec.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/hooks/useNote.js b/src/hooks/useNote.js index f1ef114e..6eb14c09 100644 --- a/src/hooks/useNote.js +++ b/src/hooks/useNote.js @@ -33,13 +33,13 @@ function useNote({ serviceClient, noteId }) { setDocId(noteId) } else if (serviceClient) { // load the note if needed - if (!doc || doc.file.id != docId) loadNote() + if (!doc || doc.file.id !== docId) loadNote() } }, [noteId, docId, setDocId, setLoading, serviceClient, setDoc, setTitle] ) - if (docId == noteId) return { loading, title, doc, setTitle } + if (docId === noteId) return { loading, title, doc, setTitle } else return { loading: true, title: undefined, doc: undefined, setTitle } } diff --git a/src/lib/collab/channel.spec.js b/src/lib/collab/channel.spec.js index c5f06c2d..21efcdf4 100644 --- a/src/lib/collab/channel.spec.js +++ b/src/lib/collab/channel.spec.js @@ -5,7 +5,7 @@ jest.mock('prosemirror-collab', () => { return { getVersion: jest.fn(), sendableSteps: jest.fn() } }) -const noteId = 'myDocId' +const noteId = 'myNoteId' const config = { noteId } const service = { pushSteps: jest.fn(),