@knowlearning/agents 0.9.39 → 0.9.41
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/auth.js
CHANGED
|
@@ -12,8 +12,7 @@ if (window.location.pathname.startsWith('/auth/')) {
|
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
function login() {
|
|
16
|
-
const provider = 'google'
|
|
15
|
+
function login(provider='google') {
|
|
17
16
|
const state = Math.random().toString(36).substring(2)
|
|
18
17
|
window.localStorage.setItem(state, window.location.href)
|
|
19
18
|
|
package/package.json
CHANGED
|
@@ -25,8 +25,11 @@
|
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
created() { this.startWatching() },
|
|
28
|
-
|
|
29
|
-
if (this.stopWatching)
|
|
28
|
+
beforeUnmount() {
|
|
29
|
+
if (this.stopWatching) {
|
|
30
|
+
this.stopWatchingAttempted = true
|
|
31
|
+
this.stopWatching()
|
|
32
|
+
}
|
|
30
33
|
},
|
|
31
34
|
methods: {
|
|
32
35
|
async startWatching() {
|
|
@@ -35,7 +38,10 @@
|
|
|
35
38
|
const metadata = await Agent.metadata(this.id)
|
|
36
39
|
this.value = this.path.length === 1 ? metadata[this.path[0]] : metadata
|
|
37
40
|
}
|
|
38
|
-
else this.stopWatching = Agent.watch([this.id, ...this.path], value =>
|
|
41
|
+
else this.stopWatching = Agent.watch([this.id, ...this.path], value => {
|
|
42
|
+
if (this.stopWatchingAttempted) console.warn('Watcher not stopped for vueScopeComponent')
|
|
43
|
+
else this.value = value
|
|
44
|
+
})
|
|
39
45
|
}
|
|
40
46
|
}
|
|
41
47
|
}
|