Skip to content

Commit 8a56a66

Browse files
risunCodeclaude
andcommitted
fix: resolve compilation errors after refactoring
- Update MainActivity to use hiltViewModel instead of viewModel - Remove reference to deleted SafetyLevel.WARNING in AppListScreen - Remove canRollback logic from SettingsScreen action history Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 4182504 commit 8a56a66

3 files changed

Lines changed: 3 additions & 9 deletions

File tree

app/src/main/java/com/appcontrolx/ui/MainActivity.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import androidx.compose.material3.MaterialTheme
99
import androidx.compose.material3.Surface
1010
import androidx.compose.ui.Modifier
1111
import androidx.lifecycle.compose.collectAsStateWithLifecycle
12-
import androidx.lifecycle.viewmodel.compose.viewModel
12+
import androidx.hilt.navigation.compose.hiltViewModel
1313
import com.appcontrolx.ui.navigation.AppNavGraph
1414
import com.appcontrolx.ui.theme.AppControlXTheme
1515
import com.appcontrolx.ui.MainViewModel
@@ -21,7 +21,7 @@ class MainActivity : ComponentActivity() {
2121
super.onCreate(savedInstanceState)
2222
enableEdgeToEdge()
2323
setContent {
24-
val viewModel: MainViewModel = viewModel()
24+
val viewModel: MainViewModel = hiltViewModel()
2525
val themeMode = viewModel.themeMode.collectAsStateWithLifecycle()
2626

2727
AppControlXTheme(

app/src/main/java/com/appcontrolx/ui/screens/apps/AppListScreen.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ private fun AppDetailSheet(
708708
Spacer(modifier = Modifier.height(12.dp))
709709

710710
val canExecute = app.safetyLevel != SafetyLevel.CRITICAL
711-
val canFreeze = app.safetyLevel == SafetyLevel.SAFE || app.safetyLevel == SafetyLevel.WARNING
711+
val canFreeze = app.safetyLevel == SafetyLevel.SAFE
712712

713713
Row(
714714
modifier = Modifier.fillMaxWidth(),

app/src/main/java/com/appcontrolx/ui/screens/settings/SettingsScreen.kt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -779,12 +779,6 @@ private fun ActionHistoryItem(
779779
color = MaterialTheme.colorScheme.onSurfaceVariant
780780
)
781781
}
782-
783-
if (item.canRollback) {
784-
TextButton(onClick = onRollback) {
785-
Text("Undo")
786-
}
787-
}
788782
}
789783
}
790784
}

0 commit comments

Comments
 (0)