Disable default script when advanced options off (#223)

This commit is contained in:
Stephen B 2025-07-12 10:30:28 -04:00 • committed by GitHub
parent 41b280f7c7
commit aaacd75432
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 5 deletions

View file

@ -303,7 +303,10 @@ struct HomeView: View {
startJITInBackground(with: selectedBundle)
}
}
.pipify(isPresented: $isProcessing) {
.pipify(isPresented: Binding(
get: { useDefaultScript && isProcessing },
set: { newValue in isProcessing = newValue }
)) {
RunJSViewPiP(model: $jsModel)
}
.sheet(isPresented: $scriptViewShow) {

View file

@ -272,16 +272,23 @@ struct SettingsView: View {
.foregroundColor(.primary)
.padding(.bottom, 4)
Toggle("Run Default Script After Connecting", isOn: $useDefaultScript)
.foregroundColor(.primary)
.padding(.vertical, 6)
Toggle("Enable Advanced Options", isOn: $enableAdvancedOptions)
.foregroundColor(.primary)
.padding(.vertical, 6)
if enableAdvancedOptions {
Toggle("Run Default Script After Connecting", isOn: $useDefaultScript)
.foregroundColor(.primary)
.padding(.vertical, 6)
}
}
.padding(.vertical, 20)
.padding(.horizontal, 16)
.onChange(of: enableAdvancedOptions) { _, newValue in
if !newValue {
useDefaultScript = false
}
}
}
// About section