Skip to content

Commit 6125ce7

Browse files
authored
Merge pull request #331 from parmar-mehul/disable-report-settings
Disable "Report" & "Settings" options in prompts
2 parents 03a7d51 + 83f89c1 commit 6125ce7

2 files changed

Lines changed: 16 additions & 4 deletions

File tree

Demo/Sources/iOS/Pulse_Demo_iOSApp.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ private final class AppViewModel: ObservableObject {
2525
init() {
2626
// This code registers the store with the `RemoteLogger` (important!)
2727
LoggerStore.shared = .demo
28+
29+
/*
30+
//Disable: options -> 1. "Settings", "Get Pulse Pro", "Report Issue"
31+
UserDefaults.standard.set(true, forKey: "pulse-disable-support-prompts")
32+
UserDefaults.standard.set(true, forKey: "pulse-disable-report-issue-prompts")
33+
UserDefaults.standard.set(true, forKey: "pulse-disable-settings-prompts")
34+
*/
2835

2936
// RemoteLogger.shared.isAutomaticConnectionEnabled = true
3037

Sources/PulseUI/Features/Console/Views/ConsoleContextMenu.swift

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,12 @@ struct ConsoleContextMenu: View {
2525
ConsoleSortByMenu()
2626
}
2727
Section {
28-
Button(action: { router.isShowingSettings = true }) {
29-
Label("Settings", systemImage: "gear")
28+
if !UserDefaults.standard.bool(forKey: "pulse-disable-settings-prompts") {
29+
Button(action: { router.isShowingSettings = true }) {
30+
Label("Settings", systemImage: "gear")
31+
}
3032
}
33+
3134
if !environment.store.options.contains(.readonly) {
3235
Button(role: .destructive, action: environment.removeAllLogs) {
3336
Label("Remove Logs", systemImage: "trash")
@@ -40,8 +43,10 @@ struct ConsoleContextMenu: View {
4043
Label("Get Pulse Pro", systemImage: "link")
4144
}
4245
}
43-
Button(action: buttonSendFeedbackTapped) {
44-
Label("Report Issue", systemImage: "envelope")
46+
if !UserDefaults.standard.bool(forKey: "pulse-disable-report-issue-prompts") {
47+
Button(action: buttonSendFeedbackTapped) {
48+
Label("Report Issue", systemImage: "envelope")
49+
}
4550
}
4651
}
4752
} label: {

0 commit comments

Comments
 (0)