File tree Expand file tree Collapse file tree
components/JottingsControls Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,18 +10,15 @@ import { compareArrays } from "../../libs/arrayExtensions";
1010export default function JottingsControl ( props ) {
1111 const [ notes , setNotes ] = useState ( null ) ;
1212 const [ tasks , setTasks ] = useState ( null ) ;
13-
14- const ownAbortController = new window . AbortController ( ) ;
15- const sharedAbortController = new window . AbortController ( ) ;
16-
13+
1714 const getJotsToShow = ( response , jotType ) => {
1815 if (
1916 response [ 1 ] . status === "rejected" &&
2017 response [ 0 ] . status === "fulfilled"
21- )
18+ )
2219 return response [ 0 ] . value [ jotType ] ;
23- else if (
24- response [ 1 ] . status === "fulfilled" &&
20+ else if (
21+ response [ 1 ] . status === "fulfilled" &&
2522 response [ 0 ] . status === "fulfilled"
2623 )
2724 return [ ...response [ 0 ] . value [ jotType ] , ...response [ 1 ] . value [ jotType ] ] ;
@@ -35,6 +32,9 @@ export default function JottingsControl(props) {
3532 } ;
3633
3734 const makeJottingsRequests = async ( interval ) => {
35+ const ownAbortController = new AbortController ( ) ;
36+ const sharedAbortController = new AbortController ( ) ;
37+
3838 if ( notes === - 1 || tasks === - 1 ) {
3939 console . info ( "Interval cleared due to errors" ) ;
4040 clearInterval ( interval ) ;
You can’t perform that action at this time.
0 commit comments