mirror of
				https://github.com/smyalygames/checklist-tester.git
				synced 2025-11-04 15:49:49 +01:00 
			
		
		
		
	fix(connector): made simConnection mutable to update SimStatus icon
This commit is contained in:
		
							parent
							
								
									3a0358ed9d
								
							
						
					
					
						commit
						2efc105ef2
					
				@ -1,7 +1,8 @@
 | 
				
			|||||||
 | 
					import androidx.compose.runtime.mutableStateOf
 | 
				
			||||||
import org.koin.core.component.KoinComponent
 | 
					import org.koin.core.component.KoinComponent
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class InterfaceState : KoinComponent {
 | 
					class InterfaceState : KoinComponent {
 | 
				
			||||||
    var simConnection: Boolean = false
 | 
					    var simConnection = mutableStateOf(false)
 | 
				
			||||||
    var projectId: Int? = null
 | 
					    var projectId: Int? = null
 | 
				
			||||||
    var procedureId: Int? = null
 | 
					    var procedureId: Int? = null
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -44,7 +44,7 @@ class SimulatorStatus {
 | 
				
			|||||||
                Spacer(Modifier.size(spacer - padding))
 | 
					                Spacer(Modifier.size(spacer - padding))
 | 
				
			||||||
                if (refresh) {
 | 
					                if (refresh) {
 | 
				
			||||||
                    RefreshIndicator()
 | 
					                    RefreshIndicator()
 | 
				
			||||||
                } else if (viewModel.simConnection) {
 | 
					                } else if (viewModel.simConnection.value) {
 | 
				
			||||||
                    Icon(
 | 
					                    Icon(
 | 
				
			||||||
                        painter = painterResource(Res.drawable.link_24px),
 | 
					                        painter = painterResource(Res.drawable.link_24px),
 | 
				
			||||||
                        contentDescription = "Simulator connected"
 | 
					                        contentDescription = "Simulator connected"
 | 
				
			||||||
@ -89,6 +89,6 @@ class SimulatorStatus {
 | 
				
			|||||||
     */
 | 
					     */
 | 
				
			||||||
    private fun loadSimulator(viewModel: InterfaceState) {
 | 
					    private fun loadSimulator(viewModel: InterfaceState) {
 | 
				
			||||||
        val xpc = XPC()
 | 
					        val xpc = XPC()
 | 
				
			||||||
        viewModel.simConnection = xpc.connected()
 | 
					        viewModel.simConnection.value = xpc.connected()
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user