react-native-tpstreams 1.0.3-debug.7 → 1.0.3-debug.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -21,7 +21,7 @@ protocol TokenRequestDelegate: AnyObject {
|
|
|
21
21
|
class TPStreamsDownloadModule: RCTEventEmitter, TPStreamsDownloadDelegate {
|
|
22
22
|
|
|
23
23
|
private let downloadManager = TPStreamsDownloadManager.shared
|
|
24
|
-
private var isListening =
|
|
24
|
+
private var isListening = false
|
|
25
25
|
private var tokenDelegate: TokenRequestDelegate?
|
|
26
26
|
private static var _shared: TPStreamsDownloadModule?
|
|
27
27
|
|
|
@@ -60,7 +60,7 @@ class TPStreamsDownloadModule: RCTEventEmitter, TPStreamsDownloadDelegate {
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
func onProgressChange(assetId: String, percentage: Double) {
|
|
63
|
-
print("TPStreamsDownloadModule onProgressChange")
|
|
63
|
+
print("TPStreamsDownloadModule onProgressChange isListening: \(isListening)")
|
|
64
64
|
if isListening {
|
|
65
65
|
print("TPStreamsDownloadModule onProgressChange notifyDownloadsChange")
|
|
66
66
|
notifyDownloadsChange()
|
|
@@ -68,7 +68,7 @@ class TPStreamsDownloadModule: RCTEventEmitter, TPStreamsDownloadDelegate {
|
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
func onStateChange(status: Status, offlineAsset: OfflineAsset) {
|
|
71
|
-
print("TPStreamsDownloadModule onStateChange")
|
|
71
|
+
print("TPStreamsDownloadModule onStateChange isListening: \(isListening)")
|
|
72
72
|
if isListening {
|
|
73
73
|
print("TPStreamsDownloadModule onStateChange notifyDownloadsChange")
|
|
74
74
|
notifyDownloadsChange()
|
|
@@ -76,7 +76,7 @@ class TPStreamsDownloadModule: RCTEventEmitter, TPStreamsDownloadDelegate {
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
func onDelete(assetId: String) {
|
|
79
|
-
print("TPStreamsDownloadModule onDelete")
|
|
79
|
+
print("TPStreamsDownloadModule onDelete isListening: \(isListening)")
|
|
80
80
|
if isListening {
|
|
81
81
|
print("TPStreamsDownloadModule onDelete notifyDownloadsChange")
|
|
82
82
|
if let offlineAsset = getOfflineAsset(assetId: assetId) {
|
|
@@ -87,7 +87,7 @@ class TPStreamsDownloadModule: RCTEventEmitter, TPStreamsDownloadDelegate {
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
func onStart(offlineAsset: OfflineAsset) {
|
|
90
|
-
print("TPStreamsDownloadModule onStart")
|
|
90
|
+
print("TPStreamsDownloadModule onStart isListening: \(isListening)")
|
|
91
91
|
if isListening {
|
|
92
92
|
print("TPStreamsDownloadModule onStart notifyDownloadsChange")
|
|
93
93
|
notifyDownloadStateChanged(offlineAsset: offlineAsset)
|
|
@@ -96,7 +96,7 @@ class TPStreamsDownloadModule: RCTEventEmitter, TPStreamsDownloadDelegate {
|
|
|
96
96
|
}
|
|
97
97
|
|
|
98
98
|
func onComplete(offlineAsset: OfflineAsset) {
|
|
99
|
-
print("TPStreamsDownloadModule onComplete")
|
|
99
|
+
print("TPStreamsDownloadModule onComplete isListening: \(isListening)")
|
|
100
100
|
if isListening {
|
|
101
101
|
print("TPStreamsDownloadModule onComplete notifyDownloadsChange")
|
|
102
102
|
notifyDownloadStateChanged(offlineAsset: offlineAsset)
|
|
@@ -136,6 +136,7 @@ class TPStreamsDownloadModule: RCTEventEmitter, TPStreamsDownloadDelegate {
|
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
private func notifyDownloadsChange() {
|
|
139
|
+
print("TPStreamsDownloadModule notifyDownloadsChange")
|
|
139
140
|
DispatchQueue.main.async { [weak self] in
|
|
140
141
|
guard let self = self else { return }
|
|
141
142
|
let downloadAssets = self.getAllDownloadItems()
|