Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/react-native-device-activity/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-native-device-activity",
"version": "0.4.22",
"version": "0.4.23",
"description": "Provides access to Apples DeviceActivity API",
"main": "build/index.js",
"types": "build/index.d.ts",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ func handleAction(
) -> ShieldActionResponse {
logger.log("handleAction")
if let type = configForSelectedAction["type"] as? String {
logger.log("type: \(type)")
if type == "disableBlockAllMode" {
disableBlockAllMode(triggeredBy: "shieldAction")
}
Expand Down Expand Up @@ -119,6 +120,7 @@ func handleAction(
}

if type == "whitelistCurrent" {
logger.log("whitelistCurrent!!!")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick (assertive)

Consider more informative logging message

While adding logging for the whitelistCurrent action is helpful, the current message with multiple exclamation marks could be more informative by including details about what's being whitelisted (app, domain, or category).

-logger.log("whitelistCurrent!!!")
+logger.log("whitelistCurrent action triggered for: app=\(applicationToken != nil), domain=\(webdomainToken != nil), category=\(categoryToken != nil)")
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
logger.log("whitelistCurrent!!!")
logger.log("whitelistCurrent action triggered for: app=\(applicationToken != nil), domain=\(webdomainToken != nil), category=\(categoryToken != nil)")

var selection = getCurrentWhitelist()

if let applicationToken = applicationToken {
Expand All @@ -138,6 +140,8 @@ func handleAction(
}
}

CFPreferencesAppSynchronize(kCFPreferencesCurrentApplication)

if let behavior = configForSelectedAction["behavior"] as? String {
if behavior == "defer" {
return .defer
Expand Down