File tree Expand file tree Collapse file tree 2 files changed +33
-5
lines changed
Expand file tree Collapse file tree 2 files changed +33
-5
lines changed Original file line number Diff line number Diff line change @@ -604,7 +604,19 @@ export default {
604604 this .selectedAttributes = []
605605 this .selectedReporting = []
606606 this .getEndpointCardData ()
607- // only show Matter features if Matter is selected
607+ }
608+ },
609+
610+ mounted () {
611+ // If this endpoint is selected when mounted, expand it with a delay to trigger animation
612+ if (this .isSelectedEndpoint ) {
613+ // Use setTimeout to ensure the transition can detect the change
614+ setTimeout (() => {
615+ this .$store .commit (' zap/toggleShowEndpoint' , {
616+ id: this .endpointReference ,
617+ value: true
618+ })
619+ }, 50 )
608620 }
609621 }
610622}
Original file line number Diff line number Diff line change @@ -60,10 +60,15 @@ export default {
6060 mixins: [CommonMixin],
6161 mounted () {
6262 // initialize ZclClusterManager with first endpoint info.
63- if (this .endpointIdListSorted .size && ! this .selectedEndpointId ) {
64- this .setSelectedEndpointType (
65- this .endpointIdListSorted .keys ().next ().value
66- )
63+ this .ensureEndpointSelected ()
64+ },
65+ watch: {
66+ endpoints: {
67+ handler () {
68+ // Auto-select first endpoint when endpoints are loaded
69+ this .ensureEndpointSelected ()
70+ },
71+ immediate: true
6772 }
6873 },
6974 computed: {
@@ -106,6 +111,17 @@ export default {
106111 // This function changing the modal state
107112 toggleCreateEndpointModal () {
108113 this .$store .commit (' zap/toggleEndpointModal' , true )
114+ },
115+ // Auto-select the first endpoint if no endpoint is currently selected
116+ ensureEndpointSelected () {
117+ if (
118+ this .endpointIdListSorted .size > 0 &&
119+ (this .selectedEndpointId == null ||
120+ this .selectedEndpointId === undefined )
121+ ) {
122+ const firstEndpointId = this .endpointIdListSorted .keys ().next ().value
123+ this .setSelectedEndpointType (firstEndpointId)
124+ }
109125 }
110126 }
111127}
You can’t perform that action at this time.
0 commit comments