Skip to content

Commit

Permalink
Fix React Hook useEffect has missing dependencies: 'image.Id' and 'im…
Browse files Browse the repository at this point in the history
…age.isSystem'
  • Loading branch information
KKoukiou committed Feb 8, 2023
1 parent 7cbed96 commit 104fa0b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/ImageHistory.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,16 @@ const IdColumn = Id => {
const ImageDetails = ({ image }) => {
const [history, setHistory] = useState([]);
const [error, setError] = useState(null);
const isSystem = image.isSystem;
const id = image.Id;

useEffect(() => {
client.imageHistory(image.isSystem, image.Id).then(setHistory)
client.imageHistory(isSystem, id).then(setHistory)
.catch(ex => {
console.error("Cannot get image history", ex);
setError(true);
});
}, []);
}, [isSystem, id]);

const columns = ["ID", _("Created"), _("Created by"), _("Size"), _("Comments")];
let showComments = false;
Expand Down

0 comments on commit 104fa0b

Please sign in to comment.