mirror of
https://github.com/leanote/leanote-ios.git
synced 2026-01-21 03:01:21 +08:00
如果已经不在本页了, 不要设置内容, alert
This commit is contained in:
@@ -38,7 +38,7 @@
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>949</string>
|
||||
<string>950</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>NSAppTransportSecurity</key>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<key>AutocorrectionType</key>
|
||||
<string>No</string>
|
||||
<key>DefaultValue</key>
|
||||
<string>1.0 (949)</string>
|
||||
<string>1.0 (950)</string>
|
||||
<key>IsSecure</key>
|
||||
<false/>
|
||||
<key>Key</key>
|
||||
|
||||
@@ -86,6 +86,7 @@ static NSInteger const MaximumNumberOfPictures = 10;
|
||||
@property (nonatomic) BOOL isMarkdown;
|
||||
|
||||
@property (nonatomic) BOOL edited;
|
||||
@property (nonatomic) BOOL isClosed;
|
||||
|
||||
@property BOOL isInited;
|
||||
|
||||
@@ -222,7 +223,7 @@ static NSInteger const MaximumNumberOfPictures = 10;
|
||||
|
||||
// 一直在loading 内容
|
||||
[self hideProgress];
|
||||
|
||||
self.isClosed = YES;
|
||||
[super viewWillDisappear:animated];
|
||||
}
|
||||
|
||||
@@ -405,13 +406,26 @@ BOOL hiddenBar = NO;
|
||||
[self showProgress];
|
||||
|
||||
[Leas.note getNoteContent:self.note success:^(NSString * content) {
|
||||
// 如果已经不在本页了 不要设置
|
||||
if(self.isClosed) {
|
||||
return;
|
||||
}
|
||||
[self setBodyText:content];
|
||||
[self enableRightButtons];
|
||||
[self hideProgress];
|
||||
} fail:^{
|
||||
// 如果已经不在本页了, 不要alert
|
||||
if(self.isClosed) {
|
||||
return;
|
||||
}
|
||||
[self hideProgress];
|
||||
[LeaAlert showAlertWithTitle:NSLocalizedString(@"Error", nil) message:NSLocalizedString(@"Cannot fetch note's content", nil) withSupportButton:NO okPressedBlock:^(UIAlertView *alertView) {
|
||||
|
||||
[LeaAlert showAlertWithTitle:NSLocalizedString(@"Error", nil) message:NSLocalizedString(@"Cannot fetch note's content", nil) withSupportButton:NO okPressedBlock:^() {
|
||||
if(self.isClosed) {
|
||||
return;
|
||||
}
|
||||
// 返回
|
||||
// 这里, 可能已不是本页
|
||||
[self.navigationController popViewControllerAnimated:YES];
|
||||
}];
|
||||
}];
|
||||
|
||||
@@ -64,7 +64,7 @@
|
||||
@param okPressedBlock a block to execute if the OK button is pressed
|
||||
*/
|
||||
+ (void)showAlertWithTitle:(NSString *)title message:(NSString *)message
|
||||
withSupportButton:(BOOL)showSupport okPressedBlock:(void (^)(UIAlertView *alertView))okBlock;
|
||||
withSupportButton:(BOOL)showSupport okPressedBlock:(void (^)())okBlock;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@@ -31,7 +31,7 @@ NSInteger const SupportButtonIndex = 0;
|
||||
else if([title isEqualToString:NSLocalizedString(@"OK", nil)])
|
||||
{
|
||||
if(self.okPressedBlock) {
|
||||
self.okPressedBlock();
|
||||
self.okPressedBlock(nil);
|
||||
self.okPressedBlock = nil;
|
||||
}
|
||||
}
|
||||
@@ -52,7 +52,7 @@ NSInteger const SupportButtonIndex = 0;
|
||||
[self showAlertWithTitle:title message:message withSupportButton:showSupport okPressedBlock:nil];
|
||||
}
|
||||
|
||||
+ (void)showAlertWithTitle:(NSString *)title message:(NSString *)message withSupportButton:(BOOL)showSupport okPressedBlock:(void (^)(UIAlertView *))okBlock
|
||||
+ (void)showAlertWithTitle:(NSString *)title message:(NSString *)message withSupportButton:(BOOL)showSupport okPressedBlock:(void (^)()) okBlock
|
||||
{
|
||||
if ([LeaAlert internalInstance].alertShowing) {
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user