Compare commits

...

7 Commits

Author SHA1 Message Date
bimgeek ce3e905d3e move resetViewerState into visualStore 2026-02-17 12:33:25 +03:00
bimgeek 6f98d79d9f deduplicate field input state update 2026-02-17 12:23:11 +03:00
bimgeek c18079bff5 fix duplicated reset sequence 2026-02-14 19:43:16 +03:00
bimgeek 29022c339b added logging 2026-02-14 19:36:55 +03:00
bimgeek 97b6c0a436 fix empty catch 2026-02-14 19:28:23 +03:00
bimgeek f85431ce34 fix object ids toast notification 2026-02-14 18:47:35 +03:00
bimgeek fad2911158 yolo 2026-02-14 18:42:22 +03:00
2 changed files with 27 additions and 0 deletions
@@ -435,6 +435,12 @@ export const useVisualStore = defineStore('visualStore', () => {
const clearDataInput = () => (dataInput.value = null)
const resetViewerState = () => {
setViewerReadyToLoad(false)
clearDataInput()
lastLoadedRootObjectId.value = undefined
isViewerObjectsLoaded.value = false
}
const setViewerReadyToLoad = (newValue: boolean) => (isViewerReadyToLoad.value = newValue)
@@ -652,6 +658,7 @@ export const useVisualStore = defineStore('visualStore', () => {
setLoadingProgress,
clearLoadingProgress,
setIsLoadingFromFile,
resetViewerState,
resetFilters,
downloadLatestVersion,
handleObjectsLoadedComplete,
+20
View File
@@ -75,15 +75,28 @@ export class Visual implements IVisual {
visualStore.setViewerReadyToLoad(false)
}
const tryUpdateFieldInputState = () => {
try {
const matrixView = options.dataViews[0]?.matrix
if (matrixView) {
visualStore.setFieldInputState(validateMatrixView(options))
}
} catch (e) {
console.warn('Failed to update field input state during skip path:', (e as Error).message)
}
}
if (visualStore.postFileSaveSkipNeeded) {
visualStore.setPostFileSaveSkipNeeded(false)
console.log('Skipping unneccessary update function after file save.')
tryUpdateFieldInputState()
return
}
if (visualStore.postClickSkipNeeded) {
visualStore.setPostClickSkipNeeded(false)
console.log('Skipping unneccessary update function canvas click.')
tryUpdateFieldInputState()
return
}
@@ -136,6 +149,12 @@ export class Visual implements IVisual {
visualStore.setFieldInputState(validationResult)
console.log('❓Field inputs', validationResult)
if (!validationResult.rootObjectId) {
console.log('🔄 Root object ID removed - resetting viewer state')
visualStore.resetViewerState()
return
}
switch (options.type) {
case powerbi.VisualUpdateType.Resize:
case powerbi.VisualUpdateType.ResizeEnd:
@@ -326,6 +345,7 @@ export class Visual implements IVisual {
colorBy: false,
tooltipData: false
})
visualStore.resetViewerState()
return
}
}