mirror of
https://github.com/zhigang1992/GitHawk.git
synced 2026-05-24 08:54:10 +08:00
prevent slack cache from overwriting text (#1129)
This commit is contained in:
@@ -74,7 +74,7 @@ final class TextActionsController: NSObject,
|
||||
// MARK: ImageUploadDelegate
|
||||
|
||||
func imageUploaded(link: String, altText: String) {
|
||||
textView?.replace(left: ")", right: nil, atLineStart: true)
|
||||
textView?.replace(left: ")", right: nil, atLineStart: false)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1904,8 +1904,9 @@ CGFloat const SLKAutoCompletionViewDefaultHeight = 140.0;
|
||||
cachedAttributedText = [NSKeyedUnarchiver unarchiveObjectWithData:obj];
|
||||
}
|
||||
}
|
||||
|
||||
if (self.textView.attributedText.length == 0 || cachedAttributedText.length > 0) {
|
||||
|
||||
// only update the text if it is empty on the first load
|
||||
if (self.textView.attributedText.length == 0 && cachedAttributedText.length > 0) {
|
||||
self.textView.attributedText = cachedAttributedText;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user