File tree Expand file tree Collapse file tree 2 files changed +15
-8
lines changed Expand file tree Collapse file tree 2 files changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import React from "react";
7
7
import ReactDOM from "react-dom" ;
8
8
import "bootstrap/dist/css/bootstrap.min.css" ;
9
9
import "bootstrap/dist/js/bootstrap.bundle.min" ;
10
- import { HashRouter as Router } from "react-router-dom" ;
10
+ import { MemoryRouter as Router } from "react-router-dom" ;
11
11
import AppView from "./views/app-view" ;
12
12
13
13
/**
Original file line number Diff line number Diff line change @@ -55,15 +55,19 @@ const LabelView = () => {
55
55
const website = params . website ; // Get website passed from route
56
56
const label = params . label ; // Get label passed from route
57
57
58
- useEffect (
59
- ( ) =>
60
- // @ts -ignore
61
- getWebsiteLastVisitedEvidence ( website ) . then ( ( result ) => {
58
+ useEffect ( ( ) => {
59
+ // Define an async function inside the effect
60
+ async function fetchData ( ) {
61
+ try {
62
+ const result = await getWebsiteLastVisitedEvidence ( website ) ;
62
63
const a = result ?. [ label ] ?? { } ;
63
64
setRequests ( a ) ;
64
- } ) ,
65
- [ ]
66
- ) ;
65
+ } catch ( err ) {
66
+ console . error ( "Failed to load website evidence:" , err ) ;
67
+ }
68
+ }
69
+ fetchData ( ) ;
70
+ } , [ ] ) ;
67
71
68
72
return (
69
73
< Scaffold
@@ -72,6 +76,7 @@ const LabelView = () => {
72
76
leading = {
73
77
< SLeading
74
78
onClick = { ( ) => {
79
+ console . log ( "clicked" ) ;
75
80
navigate ( "/" , { replace : true } ) ;
76
81
const getAnalysis = async ( ) => {
77
82
const status = await getAnalyticsStatus ( ) ;
@@ -85,7 +90,9 @@ const LabelView = () => {
85
90
) ;
86
91
}
87
92
} ;
93
+ console . log ( "clicked3" ) ;
88
94
getAnalysis ( ) ;
95
+ console . log ( "clicked4" ) ;
89
96
} }
90
97
>
91
98
< Icons . Back size = "24px" />
You can’t perform that action at this time.
0 commit comments