File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -79,18 +79,23 @@ function CheckUpdate(): React.ReactNode {
7979 style = { [ styles . updateButton , currentStyle ?. button_style ] }
8080 onPress = { ( ) => {
8181 setLoading ( true ) ;
82- Updates . checkForUpdateAsync ( )
83- . then ( res => {
84- if ( ! res . isAvailable ) {
85- Toast . show ( { text : '已是最新版' , icon : 'success' } ) ;
86- }
87- } )
88- . catch ( err => {
89- Toast . show ( { text : err . toString ( ) } ) ;
90- } )
91- . finally ( ( ) => {
92- setLoading ( false ) ;
93- } ) ;
82+ if ( __DEV__ ) {
83+ Toast . show ( { text : '已是最新版' , icon : 'success' } ) ;
84+ setLoading ( false ) ;
85+ } else {
86+ Updates . checkForUpdateAsync ( )
87+ . then ( res => {
88+ if ( ! res . isAvailable ) {
89+ Toast . show ( { text : '已是最新版' , icon : 'success' } ) ;
90+ }
91+ } )
92+ . catch ( err => {
93+ Toast . show ( { text : err . toString ( ) } ) ;
94+ } )
95+ . finally ( ( ) => {
96+ setLoading ( false ) ;
97+ } ) ;
98+ }
9499 } }
95100 isLoading = { loading }
96101 >
Original file line number Diff line number Diff line change @@ -50,7 +50,9 @@ export default function RootLayout() {
5050 // 配置Toast
5151 Toast . config ( { mask : false , stackable : true } ) ;
5252 // 获取更新
53- fetchUpdate ( ) ;
53+ if ( ! __DEV__ ) {
54+ fetchUpdate ( ) ;
55+ }
5456 // 在 store 中设置爬虫 ref
5557 setRef ( scraperRef as React . RefObject < WebView > ) ;
5658 // 在 store 中配置 portal ref
You can’t perform that action at this time.
0 commit comments