Skip to content

Commit 73bdecc

Browse files
committed
fix loggin nsexception without userinfo
1 parent 4ed4367 commit 73bdecc

File tree

4 files changed

+22
-18
lines changed

4 files changed

+22
-18
lines changed

package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"link": "npm run build && skpm-link",
3030
"lint-staged": "lint-staged",
3131
"lint": "eslint --quiet --ignore-path=.gitignore .",
32-
"prettier:base": "prettier --single-quote --trailing-comma es5 --no-semi --write",
32+
"prettier:base": "prettier --write",
3333
"prettify": "npm run prettier:base \"./src/**/*.{js,jsx}\" \"./resources/**/*.{js,jsx}\""
3434
},
3535
"devDependencies": {
@@ -71,7 +71,7 @@
7171
},
7272
"dependencies": {
7373
"sketch-module-web-view": "^1.2.3",
74-
"sketch-utils": "^0.2.4"
74+
"sketch-utils": "^0.2.6"
7575
},
7676
"resources": [
7777
"resources/webview.js"

prettier.config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
singleQuote: true,
3+
trailingComma: 'es5',
4+
semi: false,
5+
}

src/catch-all-actions.js

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,31 @@ export function onAction(context) {
1111
if (!isDebuggerPresent()) {
1212
return undefined
1313
}
14+
const { action, actionContext } = context
1415
const options = {
1516
withAncestors: Settings.settingForKey('withAncestors') || false,
1617
sourcemaps:
1718
typeof Settings.settingForKey('sourcemaps') !== 'undefined'
1819
? Settings.settingForKey('sourcemaps')
1920
: true,
2021
}
21-
const name = String(context.action)
22+
const name = String(action)
2223
if (name === LOG_ACTION) {
2324
const ourCommand = String(__command.identifier())
24-
const commandTriggeringTheLog = String(
25-
context.actionContext.command.identifier()
26-
)
25+
const commandTriggeringTheLog = String(actionContext.command.identifier())
2726
if (commandTriggeringTheLog !== ourCommand) {
2827
const values = []
29-
const nativeValues = context.actionContext.payload
28+
const nativeValues = actionContext.payload
3029
for (let i = 0; i < nativeValues.length; i += 1) {
3130
values.push(prepareValue(nativeValues[i], options))
3231
}
3332
const payload = {
3433
ts: Date.now(),
35-
type: String(context.actionContext.level),
34+
type: String(actionContext.level),
3635
values,
3736
stack: [
3837
{
39-
file: String(context.actionContext.command.identifier()),
38+
file: commandTriggeringTheLog,
4039
},
4140
],
4241
}
@@ -46,6 +45,6 @@ export function onAction(context) {
4645
}
4746
sendToDebugger(ADD_ACTION, {
4847
name,
49-
context: prepareValue(context.actionContext, options),
48+
context: prepareValue(actionContext, options),
5049
})
5150
}

0 commit comments

Comments
 (0)