Skip to content

Commit

Permalink
deep watch lists
Browse files Browse the repository at this point in the history
If lists are not deep watched, no changes are registered at all
  • Loading branch information
TarikViehmann committed Jan 28, 2024
1 parent 734d462 commit a71c79a
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/spectator/entities/MachineEntity.vue
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ watch(
workpiece.holding == false && workpiece.at_machine == props.machine.name
)
},
{ immediate: true }
{ deep: true, immediate: true }
)
</script>

Expand Down
2 changes: 1 addition & 1 deletion src/components/spectator/entities/RobotEntity.vue
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ watch(
workpiece.robot_holding == props.robot.number
)
},
{ immediate: true }
{ deep: true, immediate: true }
)
</script>

Expand Down
2 changes: 1 addition & 1 deletion src/store/eventStore.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ref, type Ref, computed, watch, ComputedRef } from 'vue'
import { ref, type Ref, computed, ComputedRef } from 'vue'
import { defineStore } from 'pinia'
import { useGameStore } from '@/store/gameStore'
import type GameEvent from '@/types/GameEvent'
Expand Down
6 changes: 4 additions & 2 deletions src/store/reportStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -444,7 +444,8 @@ export const useReportStore = defineStore('reportStore', () => {
() => activeAgentTasks.value,
(newActiveAgentTasks, _) => {
robotStore.agentTasks = newActiveAgentTasks
}
},
{ deep: true }
)

// whenever the computed property `activeWorkpieces` changes, update the
Expand All @@ -453,7 +454,8 @@ export const useReportStore = defineStore('reportStore', () => {
() => activeWorkpieces.value,
(newWorkpieces, _) => {
orderStore.workpieces = newWorkpieces
}
},
{ deep: true }
)

// EXPORTS - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Expand Down

0 comments on commit a71c79a

Please sign in to comment.