Skip to content

Commit

Permalink
🐞fix(插件 > 报菜名): 优化了注入逻辑,有效减轻了卡顿问题
Browse files Browse the repository at this point in the history
  • Loading branch information
iamapig120 committed Jun 10, 2020
1 parent 2cd335c commit 8cd5219
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion extension/reportVoice/extension.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "reportVoice",
"version": "3.0.0",
"version": "3.0.1",
"name": "解锁所有语音",
"author": "Majsoul Plus Team",
"description": "可以在本地解锁全部角色语音。\n让您获得完整麻将体验。",
Expand Down
9 changes: 5 additions & 4 deletions extension/reportVoice/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@ const autoRun = () => {
try {
if (cfg.voice.sound) {
const raw = cfg.voice.sound
let timer = 0
const proxy = new Proxy(raw, {
get(target, key) {
console.log('Get', key)
setTimeout(hackVoice, 0)
clearTimeout(timer)
timer = setTimeout(hackVoice, 0)
return target[key]
},
set(target, key, value) {
console.log('Set', key, value)
target[key] = value
setTimeout(hackVoice, 0)
clearTimeout(timer)
timer = setTimeout(hackVoice, 0)
return true
}
})
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "majsoul-plus",
"version": "2.0.0",
"version": "2.0.1",
"productName": "Majsoul Plus",
"author": "Majsoul Plus Team",
"description": "Majsoul Plus",
Expand Down

0 comments on commit 8cd5219

Please sign in to comment.