Skip to content

Commit 289b7ca

Browse files
author
Arief Nur Putranto
committed
bugfix crash
1 parent 9933d1d commit 289b7ca

File tree

5 files changed

+14
-10
lines changed

5 files changed

+14
-10
lines changed

QiscusCore.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Pod::Spec.new do |s|
22
s.name = "QiscusCore"
3-
s.version = "1.13.6"
3+
s.version = "1.13.7"
44
s.summary = "Qiscus Core SDK for iOS"
55
s.description = <<-DESC
66
Qiscus SDK for iOS contains Qiscus public Model.
@@ -14,7 +14,7 @@ s.source_files = "QiscusCore", "Source/QiscusCore/**/*.{h,m,swift,xib}"
1414
s.resource_bundles = {
1515
'QiscusCore' => ['Source/QiscusCore/**/*.{lproj,xib,xcassets,imageset,png,xcdatamodeld,xcdatamodel}']
1616
}
17-
s.platform = :ios, "10.0"
17+
s.platform = :ios, "11.0"
1818
s.ios.frameworks = ["UIKit", "QuartzCore", "CFNetwork", "Security", "Foundation", "MobileCoreServices", "CoreData"]
1919
s.dependency 'QiscusRealtime', '1.7.0'
2020
s.dependency 'SwiftyJSON'

Source/QiscusCore/Database/CommentStorage.swift

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,13 @@ class CommentStorage : QiscusStorage {
189189

190190
// update/replace === identical object
191191
private func updateCommentDataEvent(old: CommentModel, new: CommentModel) -> Bool{
192-
if let index = data.index(where: { $0 === old }) {
193-
data[index] = new
194-
return true
195-
}else {
196-
return false
192+
DispatchQueue.global(qos: .background).sync {
193+
if let index = data.index(where: { $0 === old }) {
194+
data[index] = new
195+
return true
196+
}else {
197+
return false
198+
}
197199
}
198200
}
199201

Source/QiscusCore/QiscusCore.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import Foundation
1010
import UIKit
1111

1212
public class QiscusCore: NSObject {
13-
public static let qiscusCoreVersionNumber:String = "1.13.6"
13+
public static let qiscusCoreVersionNumber:String = "1.13.7"
1414
class var bundle:Bundle{
1515
get{
1616
let podBundle = Bundle(for: QiscusCore.self)

Source/QiscusCore/QiscusWorkerManager.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ class QiscusWorkerManager {
196196
}
197197

198198
private func pending() {
199-
DispatchQueue.global(qos: .background).async {
199+
DispatchQueue.global(qos: .background).sync {
200200
self.sendPendingMessage()
201201
}
202202
}

Source/QiscusCore/Realtime/RealtimeManager.swift

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,9 @@ class RealtimeManager {
710710
if let commentDB = QiscusCore.database.comment.find(id: comment.roomId){
711711
//ignored for status sent from my self / after postComment
712712
}else{
713-
QiscusCore.database.comment.save([comment])
713+
DispatchQueue.global(qos: .background).sync {
714+
QiscusCore.database.comment.save([comment])
715+
}
714716
}
715717

716718

0 commit comments

Comments
 (0)