@@ -28,37 +28,29 @@ export const mutations = {
2828 } ,
2929
3030 setPrinterInfo ( state , payload : Moonraker . KlippyApis . Info ) {
31- state . info = payload
32- } ,
33-
34- setPrinterObjectList ( state , payload ) {
35- if ( ! state . printer . objects . includes ( payload ) ) {
36- state . printer . objects . push ( payload )
37- }
31+ state . info = Object . freeze ( payload )
3832 } ,
3933
4034 setClearEndStops ( state ) {
41- if ( state . printer . query_endstops == null ) {
35+ const queryEndstops = state . printer . query_endstops
36+
37+ if ( queryEndstops == null ) {
4238 return
4339 }
4440
45- state . printer . query_endstops = {
46- ...state . printer . query_endstops ,
47- last_query : { }
48- }
41+ queryEndstops . last_query = Object . freeze ( { } )
4942 } ,
5043
5144 setClearScrewsTiltAdjust ( state ) {
52- if ( state . printer . screws_tilt_adjust == null ) {
45+ const screwsTiltAdjust = state . printer . screws_tilt_adjust
46+
47+ if ( screwsTiltAdjust == null ) {
5348 return
5449 }
5550
56- state . printer . screws_tilt_adjust = {
57- ...state . printer . screws_tilt_adjust ,
58- error : false ,
59- max_deviation : null ,
60- results : { }
61- }
51+ screwsTiltAdjust . error = false
52+ screwsTiltAdjust . max_deviation = null
53+ screwsTiltAdjust . results = Object . freeze ( { } )
6254 } ,
6355
6456 setSocketNotify < T extends keyof Klipper . PrinterState > ( state : PrinterState , payload : { key : T , payload : Klipper . PrinterState [ T ] } ) {
0 commit comments