From ca8f768f84e1f06aa4150e4d9fec670532def8b6 Mon Sep 17 00:00:00 2001 From: ta264 Date: Wed, 30 Jun 2021 21:32:59 +0100 Subject: [PATCH] Fixed: Error adding book to existing author in incognito session --- frontend/src/Utilities/Book/getNewBook.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/Utilities/Book/getNewBook.js b/frontend/src/Utilities/Book/getNewBook.js index 9cde4259c..05c865e55 100644 --- a/frontend/src/Utilities/Book/getNewBook.js +++ b/frontend/src/Utilities/Book/getNewBook.js @@ -5,7 +5,9 @@ function getNewBook(book, payload) { searchForNewBook = false } = payload; - getNewAuthor(book.author, payload); + if (!('id' in book.author) || book.author.id === 0) { + getNewAuthor(book.author, payload); + } book.addOptions = { searchForNewBook