Skip to content

Commit

Permalink
added a download resume when tab is back in focus
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel-Cross committed Aug 12, 2024
1 parent 1f004f9 commit 998e8f4
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/components/Views/BrowserTab/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,7 @@ export const BrowserTab = (props) => {
const [blockedUrl, setBlockedUrl] = useState(undefined);
const [ipfsBannerVisible, setIpfsBannerVisible] = useState(false);
const [isResolvedIpfsUrl, setIsResolvedIpfsUrl] = useState(false);
const [isWebActivityPaused, setIsWebActivityPaused] = useState(false);

Check failure on line 270 in app/components/Views/BrowserTab/index.js

View workflow job for this annotation

GitHub Actions / scripts (lint)

'isWebActivityPaused' is assigned a value but never used
const webviewRef = useRef(null);
const blockListType = useRef('');
const allowList = useRef([]);
Expand Down Expand Up @@ -714,11 +715,13 @@ export const BrowserTab = (props) => {
webviewRef.current.injectJavaScript(`
window.isTabActive = true;
`);
setIsWebActivityPaused(false);
} else {
webviewRef.current.injectJavaScript(`
window.isTabActive = false;
`);
webviewRef.current.stopLoading(); // Stop loading the page
setIsWebActivityPaused(true);
}
}
}, [isFocused]);
Expand Down

0 comments on commit 998e8f4

Please sign in to comment.