mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-11-27 10:32:37 +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
|
@return BOOl if the input is a valid option
|
||||||
@see BITCrashManagerUserInput
|
@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
|
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) {
|
switch (userInput) {
|
||||||
case BITCrashManagerUserInputDontSend:
|
case BITCrashManagerUserInputDontSend:
|
||||||
if (self.delegate != nil && [self.delegate respondsToSelector:@selector(crashManagerWillCancelSendingCrashReport:)]) {
|
if (self.delegate != nil && [self.delegate respondsToSelector:@selector(crashManagerWillCancelSendingCrashReport:)]) {
|
||||||
@ -522,6 +522,11 @@ NSString *const kBITCrashManagerStatus = @"BITCrashManagerStatus";
|
|||||||
[self.delegate crashManagerWillSendCrashReportsAlways:self];
|
[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];
|
[self sendCrashReports];
|
||||||
return YES;
|
return YES;
|
||||||
|
|
||||||
@ -985,13 +990,13 @@ NSString *const kBITCrashManagerStatus = @"BITCrashManagerStatus";
|
|||||||
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex {
|
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex {
|
||||||
switch (buttonIndex) {
|
switch (buttonIndex) {
|
||||||
case 0:
|
case 0:
|
||||||
[self handleUserInput:BITCrashManagerUserInputDontSend withCrashMetaDescription:nil];
|
[self handleUserInput:BITCrashManagerUserInputDontSend crashMetaDescription:nil];
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
[self handleUserInput:BITCrashManagerUserInputSend withCrashMetaDescription:nil];
|
[self handleUserInput:BITCrashManagerUserInputSend crashMetaDescription:nil];
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
[self handleUserInput:BITCrashManagerUserInputAlwaysSend withCrashMetaDescription:nil];
|
[self handleUserInput:BITCrashManagerUserInputAlwaysSend crashMetaDescription:nil];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user