mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-11-25 01:22:41 +00:00
Small optimizations
This commit is contained in:
parent
27cc84a84c
commit
4aee9f81b5
@ -265,7 +265,7 @@ typedef NS_ENUM(NSUInteger, BITCrashManagerUserInput) {
|
||||
@return BOOl if the input is a valid option
|
||||
@see BITCrashManagerUserInput
|
||||
*/
|
||||
- (BOOL)handleUserInput:(BITCrashManagerUserInput)userInput withCrashMetaDescription:metaDescription;
|
||||
- (BOOL)handleUserInput:(BITCrashManagerUserInput)userInput crashMetaDescription:metaDescription;
|
||||
|
||||
/**
|
||||
Property that lets you set a custom block which handles showing a custom UI and asking the user
|
||||
|
||||
@ -496,7 +496,7 @@ NSString *const kBITCrashManagerStatus = @"BITCrashManagerStatus";
|
||||
}
|
||||
|
||||
|
||||
- (BOOL)handleUserInput:(BITCrashManagerUserInput)userInput withCrashMetaDescription:(NSString *)metaDescription{
|
||||
- (BOOL)handleUserInput:(BITCrashManagerUserInput)userInput crashMetaDescription:(NSString *)metaDescription{
|
||||
switch (userInput) {
|
||||
case BITCrashManagerUserInputDontSend:
|
||||
if (self.delegate != nil && [self.delegate respondsToSelector:@selector(crashManagerWillCancelSendingCrashReport:)]) {
|
||||
@ -522,6 +522,11 @@ NSString *const kBITCrashManagerStatus = @"BITCrashManagerStatus";
|
||||
[self.delegate crashManagerWillSendCrashReportsAlways:self];
|
||||
}
|
||||
|
||||
if (metaDescription && [metaDescription length] > 0) {
|
||||
NSError *error;
|
||||
[metaDescription writeToFile:[NSString stringWithFormat:@"%@_description.meta", [_crashesDir stringByAppendingPathComponent: _lastCrashFilename]] atomically:YES encoding:NSUTF8StringEncoding error:&error];
|
||||
}
|
||||
|
||||
[self sendCrashReports];
|
||||
return YES;
|
||||
|
||||
@ -985,13 +990,13 @@ NSString *const kBITCrashManagerStatus = @"BITCrashManagerStatus";
|
||||
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex {
|
||||
switch (buttonIndex) {
|
||||
case 0:
|
||||
[self handleUserInput:BITCrashManagerUserInputDontSend withCrashMetaDescription:nil];
|
||||
[self handleUserInput:BITCrashManagerUserInputDontSend crashMetaDescription:nil];
|
||||
break;
|
||||
case 1:
|
||||
[self handleUserInput:BITCrashManagerUserInputSend withCrashMetaDescription:nil];
|
||||
[self handleUserInput:BITCrashManagerUserInputSend crashMetaDescription:nil];
|
||||
break;
|
||||
case 2:
|
||||
[self handleUserInput:BITCrashManagerUserInputAlwaysSend withCrashMetaDescription:nil];
|
||||
[self handleUserInput:BITCrashManagerUserInputAlwaysSend crashMetaDescription:nil];
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user