@knowlearning/agents 0.9.127 → 0.9.128
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/agents/browser/initialize.js +0 -4
- package/agents/watch.js +5 -1
- package/package.json +1 -1
|
@@ -151,10 +151,6 @@ function embed(environment, iframe) {
|
|
|
151
151
|
}
|
|
152
152
|
})
|
|
153
153
|
|
|
154
|
-
// write in a temporary loading notification while frame loads
|
|
155
|
-
const cw = iframe.contentWindow
|
|
156
|
-
if (cw) cw.document.body.innerHTML = 'Loading...'
|
|
157
|
-
|
|
158
154
|
// TODO: make sure content security policy headers for embedded domain always restrict iframe
|
|
159
155
|
// src to only self for embedded domain
|
|
160
156
|
iframe.onload = () => {
|
package/agents/watch.js
CHANGED
|
@@ -80,9 +80,13 @@ export default function({ metadata, environment, state, watchers, synced, sentUp
|
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
function removeWatcher(key, fn) {
|
|
83
|
+
if (!watchers[key]) {
|
|
84
|
+
console.warn('NO WATCHERS FOR KEY', key, fn)
|
|
85
|
+
return
|
|
86
|
+
}
|
|
83
87
|
const watcherIndex = watchers[key].findIndex(x => x === fn)
|
|
84
88
|
if (watcherIndex > -1) watchers[key].splice(watcherIndex, 1)
|
|
85
|
-
else console.warn('TRIED TO REMOVE WATCHER THAT DOES NOT EXIST')
|
|
89
|
+
else console.warn('TRIED TO REMOVE WATCHER THAT DOES NOT EXIST', key, fn)
|
|
86
90
|
}
|
|
87
91
|
|
|
88
92
|
return [ watch, removeWatcher ]
|