Skip to content

Commit dfc24a5

Browse files
committed
🐛 处理GM_setValue的返回值 #493
1 parent 6b7ee3d commit dfc24a5

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/app/service/content/gm_api.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,10 @@ export default class GMApi {
187187
}
188188
if (value === undefined) {
189189
delete this.scriptRes.value[key];
190-
return this.sendMessage("GM_setValue", [key]);
190+
this.sendMessage("GM_setValue", [key]);
191191
} else {
192192
this.scriptRes.value[key] = value;
193-
return this.sendMessage("GM_setValue", [key, value]);
193+
this.sendMessage("GM_setValue", [key, value]);
194194
}
195195
}
196196

@@ -274,7 +274,9 @@ export default class GMApi {
274274

275275
// Asynchronous wrapper for GM.getValues
276276
@GMContext.API({ depend: ["GM_getValues"] })
277-
public GMDotGetValues(keysOrDefaults: { [key: string]: any } | string[] | null | undefined): Promise<{ [key: string]: any }> {
277+
public GMDotGetValues(
278+
keysOrDefaults: { [key: string]: any } | string[] | null | undefined
279+
): Promise<{ [key: string]: any }> {
278280
return new Promise((resolve) => {
279281
const ret = this.GM_getValues(keysOrDefaults);
280282
resolve(ret);

0 commit comments

Comments
 (0)