From 5018f2e8cf6a2ecaa323f667307cecd91c80baf7 Mon Sep 17 00:00:00 2001 From: Rainer Simon Date: Mon, 14 Sep 2020 12:16:07 +0200 Subject: [PATCH] Fixed linter warnings --- src/editor/widgets/Autocomplete.js | 5 +---- src/editor/widgets/comment/CommentWidget.jsx | 2 +- src/selection/SelectionHandler.js | 2 +- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/editor/widgets/Autocomplete.js b/src/editor/widgets/Autocomplete.js index fa279b9..030e7a0 100644 --- a/src/editor/widgets/Autocomplete.js +++ b/src/editor/widgets/Autocomplete.js @@ -1,4 +1,4 @@ -import React, { useState, useEffect, useRef } from 'react' +import React, { useState, useRef } from 'react' import { useCombobox } from 'downshift' const Autocomplete = props => { @@ -6,9 +6,6 @@ const Autocomplete = props => { const element = useRef(); const [ inputItems, setInputItems ] = useState(props.vocabulary); - - // useEffect(() => - // element.current?.querySelector('input')?.focus(), []); const onInputValueChange = ({ inputValue }) => { if (inputValue.length > 0) { diff --git a/src/editor/widgets/comment/CommentWidget.jsx b/src/editor/widgets/comment/CommentWidget.jsx index d312023..d74e1f6 100644 --- a/src/editor/widgets/comment/CommentWidget.jsx +++ b/src/editor/widgets/comment/CommentWidget.jsx @@ -67,7 +67,7 @@ const CommentWidget = props => { // The current user const me = Environment.user; - return !(me === creator); + return me !== creator; } // Global setting as last possible option diff --git a/src/selection/SelectionHandler.js b/src/selection/SelectionHandler.js index 2a204c9..78482fc 100644 --- a/src/selection/SelectionHandler.js +++ b/src/selection/SelectionHandler.js @@ -4,7 +4,7 @@ import EventEmitter from 'tiny-emitter'; const IS_TOUCH = 'ontouchstart' in window || navigator.maxTouchPoints > 0; const IS_INTERNET_EXPLORER = - window?.navigator.userAgent.match(/(MSIE|Trident)/); + window?.navigator?.userAgent.match(/(MSIE|Trident)/); /** Tests whether maybeChildEl is contained in containerEl **/ const contains = (containerEl, maybeChildEl) => {