File tree Expand file tree Collapse file tree 2 files changed +9
-14
lines changed
src/views/Preferences/components/tabs Expand file tree Collapse file tree 2 files changed +9
-14
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " browsernaut" ,
33 "private" : true ,
4- "version" : " 1.1.1 " ,
4+ "version" : " 1.1.2 " ,
55 "type" : " module" ,
66 "scripts" : {
77 "app:version" : " echo $npm_package_version" ,
Original file line number Diff line number Diff line change @@ -29,24 +29,20 @@ export const TabAbout = (): JSX.Element => {
2929 setIsCheckingForUpdate ( true ) ;
3030 setUpdateButtonContent ( 'Checking for update.' ) ;
3131
32- try {
33- const interval = setInterval ( ( ) => {
34- setUpdateButtonContent ( ( prev ) => {
35- if ( prev . endsWith ( '...' ) ) {
36- return prev . replace ( '...' , '.' ) ;
37- }
38- return prev + '.' ;
39- } ) ;
40- } , 500 ) ;
32+ const resetTimeout = setTimeout ( ( ) => {
33+ setIsCheckingForUpdate ( false ) ;
34+ setUpdateButtonContent ( BUTTON_UPDATE_STRING ) ;
35+ } , 6000 ) ;
4136
37+ try {
4238 const updateResult = await checkUpdate ( ) ;
43- clearInterval ( interval ) ;
44-
4539 if ( updateResult . shouldUpdate ) {
4640 const result = await confirm (
4741 'There is an update available. Would you like to update now?'
4842 ) ;
49-
43+ //? This isn't working as expected, the promise seems to never resolve if the user clicks no.
44+ clearTimeout ( resetTimeout ) ;
45+ setUpdateButtonContent ( 'Update available!' ) ;
5046 if ( result ) {
5147 await installUpdate ( ) ;
5248 return ;
@@ -74,7 +70,6 @@ export const TabAbout = (): JSX.Element => {
7470 >
7571 { updateButtonContent }
7672 </ Button >
77-
7873 < div className = "gap-4 mt-auto mb-8" >
7974 < p > Copyright © Billy Jacoby</ p >
8075 < Button variant = { 'link' } onClick = { ( ) => openURL ( { URL : HOMEPAGE_URL } ) } >
You can’t perform that action at this time.
0 commit comments