ngx-rendering-service-lib 0.0.16 → 0.0.17
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.
- package/assets/edu-service-worker.js +28 -26
- package/package.json +1 -1
|
@@ -169,32 +169,34 @@ const storeSessionIdToDb = (dbRequest, sessionId) => {
|
|
|
169
169
|
*/
|
|
170
170
|
const retrieveSessionIdFromDb = (dbRequest) => {
|
|
171
171
|
return new Promise((resolve, reject) => {
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
172
|
+
dbRequest.onsuccess = () => {
|
|
173
|
+
let result = ""
|
|
174
|
+
const db = dbRequest.result
|
|
175
|
+
const transaction = db.transaction(DB_STORE, "readwrite")
|
|
176
|
+
const store = transaction.objectStore(DB_STORE)
|
|
177
|
+
const idQuery = store.get(1)
|
|
178
|
+
idQuery.onsuccess = () => {
|
|
179
|
+
result = idQuery.result.sessionId
|
|
180
|
+
}
|
|
181
|
+
idQuery.onerror = () => {
|
|
182
|
+
console.error("Query by id failed")
|
|
183
|
+
}
|
|
184
|
+
transaction.oncomplete = () => {
|
|
185
|
+
db.close()
|
|
186
|
+
resolve(result)
|
|
187
|
+
}
|
|
188
|
+
transaction.onerror = (event) => {
|
|
189
|
+
db.close()
|
|
190
|
+
console.error("DB transaction failed. Cannot retrieve session id.")
|
|
191
|
+
console.error(event)
|
|
192
|
+
reject(new Error("Transaction failed"))
|
|
193
|
+
}
|
|
194
|
+
transaction.onabort = (ev) => {
|
|
195
|
+
db.close()
|
|
196
|
+
console.error("DB transaction aborted. Cannot retrieve session id.")
|
|
197
|
+
console.error(ev)
|
|
198
|
+
reject(new Error("Transaction aborted"))
|
|
199
|
+
}
|
|
198
200
|
}
|
|
199
201
|
})
|
|
200
202
|
}
|