@knowlearning/agents 0.9.124 → 0.9.126

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.
@@ -11,6 +11,10 @@ function isLocal() { return localStorage.getItem('api') === 'local' }
11
11
 
12
12
  const API_HOST = isLocal() ? DEVELOPMENT_HOST : REMOTE_HOST
13
13
 
14
+ // TODO: remove this hack when we can set sid cookie through websocket handshake
15
+ fetch(`http${ SECURE ? 's' : '' }://${API_HOST}/_sid-check`, { method: 'GET', credentials: 'include' })
16
+ .then(response => response.status === 201 && location.reload())
17
+
14
18
  export default options => {
15
19
  const { host } = window.location
16
20
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@knowlearning/agents",
3
- "version": "0.9.124",
3
+ "version": "0.9.126",
4
4
  "description": "API for embedding applications in KnowLearning systems.",
5
5
  "main": "node.js",
6
6
  "browser": "browser.js",
@@ -1,8 +1,8 @@
1
1
  <template>
2
- <span>
3
- <span v-if="value">{{ value === null && placeholder ? placeholder : value }}</span>
4
- <span v-else>loading...</span>
5
- </span>
2
+ <slot :loading="loading" :value="value">
3
+ <span v-if="loading">loading...</span>
4
+ <span v-else>{{ value === null && placeholder ? placeholder : value }}</span>
5
+ </slot>
6
6
  </template>
7
7
 
8
8
  <script>
@@ -17,6 +17,7 @@ export default {
17
17
  },
18
18
  setup(props) {
19
19
  const value = ref(undefined)
20
+ const loading = ref(true)
20
21
  let stopWatching
21
22
  let stopWatchingAttempted = false
22
23
 
@@ -31,13 +32,14 @@ export default {
31
32
  else value.value = val
32
33
  })
33
34
  }
35
+ loading.value = false
34
36
  }
35
37
 
36
38
  watch( [() => props.id, () => props.path], startWatching, { deep: true })
37
39
  onMounted(() => startWatching())
38
40
  onBeforeUnmount(() => stopWatching && stopWatching())
39
41
 
40
- return { value }
42
+ return { loading, value }
41
43
  }
42
44
  };
43
45
  </script>