Spaces:
Running
Running
Jimin Huang
commited on
Commit
·
82251ef
1
Parent(s):
75aba8e
Change settings
Browse files- src/components/HeaderOpen.vue +0 -2
- src/views/LiveView.vue +17 -5
src/components/HeaderOpen.vue
CHANGED
|
@@ -30,8 +30,6 @@ export default {
|
|
| 30 |
hostingLogos: [
|
| 31 |
{ name: 'DeepKin', src: new URL('../assets/images/companies_images/deepkin_logo.png', import.meta.url).href },
|
| 32 |
{ name: 'The Fin AI', src: new URL('../assets/images/companies_images/logofinai.png', import.meta.url).href },
|
| 33 |
-
{ name: 'NaCTeM', src: new URL('../assets/images/companies_images/nactemlogo.png', import.meta.url).href },
|
| 34 |
-
{ name: 'PAAL AI', src: new URL('../assets/images/companies_images/paalai_logo.png', import.meta.url).href }
|
| 35 |
],
|
| 36 |
};
|
| 37 |
},
|
|
|
|
| 30 |
hostingLogos: [
|
| 31 |
{ name: 'DeepKin', src: new URL('../assets/images/companies_images/deepkin_logo.png', import.meta.url).href },
|
| 32 |
{ name: 'The Fin AI', src: new URL('../assets/images/companies_images/logofinai.png', import.meta.url).href },
|
|
|
|
|
|
|
| 33 |
],
|
| 34 |
};
|
| 35 |
},
|
src/views/LiveView.vue
CHANGED
|
@@ -136,14 +136,22 @@ const refreshing = ref(false)
|
|
| 136 |
let allDecisions = []
|
| 137 |
const cards = shallowRef([])
|
| 138 |
|
|
|
|
|
|
|
| 139 |
/* ---------- bootstrap ---------- */
|
| 140 |
onMounted(async () => {
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
|
|
|
|
| 146 |
rowsRef.value = Array.isArray(dataService.tableRows) ? dataService.tableRows : []
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 147 |
if (!orderedAssets.includes(asset.value)) asset.value = orderedAssets[0]
|
| 148 |
|
| 149 |
allDecisions = getAllDecisions() || []
|
|
@@ -155,6 +163,10 @@ onMounted(async () => {
|
|
| 155 |
}
|
| 156 |
})
|
| 157 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 158 |
/* ---------- refresh data ---------- */
|
| 159 |
async function refreshData() {
|
| 160 |
if (refreshing.value) return
|
|
|
|
| 136 |
let allDecisions = []
|
| 137 |
const cards = shallowRef([])
|
| 138 |
|
| 139 |
+
let unsubscribe = null
|
| 140 |
+
|
| 141 |
/* ---------- bootstrap ---------- */
|
| 142 |
onMounted(async () => {
|
| 143 |
+
|
| 144 |
+
unsubscribe = dataService.subscribe((state) => {
|
| 145 |
+
rowsRef.value = Array.isArray(state.tableRows) ? state.tableRows : []
|
| 146 |
+
})
|
| 147 |
+
|
| 148 |
+
// 2) immediate sync with current state (in case data already loaded)
|
| 149 |
rowsRef.value = Array.isArray(dataService.tableRows) ? dataService.tableRows : []
|
| 150 |
+
|
| 151 |
+
// 3) trigger a load only if nothing is in-flight
|
| 152 |
+
if (!dataService.loaded && !dataService.loading) {
|
| 153 |
+
dataService.load(false).catch(e => console.error('LiveView: load failed', e))
|
| 154 |
+
}
|
| 155 |
if (!orderedAssets.includes(asset.value)) asset.value = orderedAssets[0]
|
| 156 |
|
| 157 |
allDecisions = getAllDecisions() || []
|
|
|
|
| 163 |
}
|
| 164 |
})
|
| 165 |
|
| 166 |
+
onBeforeUnmount(() => {
|
| 167 |
+
if (unsubscribe) { unsubscribe(); unsubscribe = null }
|
| 168 |
+
})
|
| 169 |
+
|
| 170 |
/* ---------- refresh data ---------- */
|
| 171 |
async function refreshData() {
|
| 172 |
if (refreshing.value) return
|