conforming to coding guidelines 1

This commit is contained in:
kg422 2015-08-14 11:28:37 -07:00
Родитель 9829b416e2
Коммит f206ce3cef
3 изменённых файлов: 8 добавлений и 10 удалений

Просмотреть файл

@ -76,7 +76,7 @@ var styles = StyleSheet.create({
},
instructions: {
textAlign: 'center',
color: '#333333',
color: '#0000ff',
marginBottom: 5,
},
});

Просмотреть файл

@ -45,14 +45,14 @@ function queryUpdate(callback) {
getSdk(function(err, sdk) {
if (err) callback(err);
NativeHybridMobileDeploy.getLocalPackage(function(err, localPackage) {
if(err){
if (err) {
console.log(err);
var pkg = {appVersion: configuration.appVersion};
sdk.queryUpdateWithCurrentPackage(pkg, callback);
}else if(localPackage == null){
} else if (localPackage == null) {
var pkg = {appVersion: configuration.appVersion};
sdk.queryUpdateWithCurrentPackage(pkg, callback);
}else{
} else {
sdk.queryUpdateWithCurrentPackage(localPackage, callback);
}
});

Просмотреть файл

@ -111,6 +111,7 @@ RCT_EXPORT_METHOD(installUpdate:(NSDictionary*)updatePackage
if (![[NSFileManager defaultManager] fileExistsAtPath:packageFolderPath]) {
[[NSFileManager defaultManager] createDirectoryAtPath:packageFolderPath withIntermediateDirectories:YES attributes:nil error:&saveError];
}
[packageJsonString writeToFile:[HybridMobileDeploy getPackagePath]
atomically:YES
encoding:NSUTF8StringEncoding
@ -140,8 +141,7 @@ RCT_EXPORT_METHOD(getLocalPackage: (RCTResponseSenderBlock)callback)
NSError* readError;
NSString *content = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:&readError];
if(readError){
if (readError) {
callback(@[RCTMakeError(@"Error finding local package ", readError, [[NSDictionary alloc] initWithObjectsAndKeys:path,@"packagePath", nil]), [NSNull null]]);
}else{
NSError * parseError;
@ -149,17 +149,15 @@ RCT_EXPORT_METHOD(getLocalPackage: (RCTResponseSenderBlock)callback)
NSDictionary* json = [NSJSONSerialization JSONObjectWithData:data
options:kNilOptions
error:&parseError];
if(parseError){
if (parseError) {
callback(@[RCTMakeError(@"Error parsing contents of local package ", parseError, [[NSDictionary alloc] initWithObjectsAndKeys:path,@"packagePath", nil]), [NSNull null]]);
}else{
} else {
callback(@[[NSNull null], json]);
}
}
});
}
@end