mirror of
				https://gitcode.com/gh_mirrors/re/react-native-pushy.git
				synced 2025-11-04 15:23:11 +08:00 
			
		
		
		
	v10.10.2
This commit is contained in:
		@@ -270,21 +270,28 @@ export const PushyProvider = ({
 | 
				
			|||||||
      } catch {
 | 
					      } catch {
 | 
				
			||||||
        return false;
 | 
					        return false;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      if (payload && payload.type) {
 | 
					      if (payload && payload.type && payload.type.startsWith('__rnPushy')) {
 | 
				
			||||||
 | 
					        const logger = options.logger || (() => {});
 | 
				
			||||||
 | 
					        options.logger = ({ type, data }) => {
 | 
				
			||||||
 | 
					          logger({ type, data });
 | 
				
			||||||
 | 
					          Alert.alert(type, JSON.stringify(data));
 | 
				
			||||||
 | 
					        };
 | 
				
			||||||
        if (payload.type === '__rnPushyVersionHash') {
 | 
					        if (payload.type === '__rnPushyVersionHash') {
 | 
				
			||||||
          await checkUpdate({ toHash: payload.data });
 | 
					          checkUpdate({ toHash: payload.data }).then(() => {
 | 
				
			||||||
            if (updateInfoRef.current && updateInfoRef.current.upToDate) {
 | 
					            if (updateInfoRef.current && updateInfoRef.current.upToDate) {
 | 
				
			||||||
              Alert.alert(
 | 
					              Alert.alert(
 | 
				
			||||||
                '提示',
 | 
					                '提示',
 | 
				
			||||||
                '当前尚未检测到更新版本,如果是首次扫码,请等待服务器端生成补丁包后再试(约10秒)',
 | 
					                '当前尚未检测到更新版本,如果是首次扫码,请等待服务器端生成补丁包后再试(约10秒)',
 | 
				
			||||||
              );
 | 
					              );
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
          return true;
 | 
					            options.logger = logger;
 | 
				
			||||||
 | 
					          });
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					        return true;
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
      return false;
 | 
					      return false;
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    [checkUpdate],
 | 
					    [checkUpdate, options],
 | 
				
			||||||
  );
 | 
					  );
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  return (
 | 
					  return (
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user