Skip to content

Commit e2dcce6

Browse files
committed
tag 和 commit 对应的 代码文件 不可删除
1 parent 1e43a87 commit e2dcce6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Coding_iOS/Controllers/CodeViewController.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ - (void)rightNavBtnClicked{
161161
[actionTitles removeObjectAtIndex:0];
162162
}
163163
__weak typeof(self) weakSelf = self;
164-
[[UIActionSheet bk_actionSheetCustomWithTitle:nil buttonTitles:actionTitles destructiveTitle:@"删除文件" cancelTitle:@"取消" andDidDismissBlock:^(UIActionSheet *sheet, NSInteger index) {
164+
[[UIActionSheet bk_actionSheetCustomWithTitle:nil buttonTitles:actionTitles destructiveTitle:self.myCodeFile.can_edit? @"删除文件": nil cancelTitle:@"取消" andDidDismissBlock:^(UIActionSheet *sheet, NSInteger index) {
165165
[weakSelf actionSheetClicked:sheet index:index];
166166
}] showInView:self.view];
167167
}
@@ -176,7 +176,7 @@ - (void)actionSheetClicked:(UIActionSheet *)sheet index:(NSInteger)index{
176176
[self goToCommitsVC];
177177
}else if (index == 2){
178178
[self popOut];
179-
}else if (index == 3){
179+
}else if (index == 3 && self.myCodeFile.can_edit){
180180
[self deleteBtnClicked];
181181
}
182182
}

0 commit comments

Comments
 (0)