Skip to content

Commit bcb3960

Browse files
committed
fix: 控制面板无法复制
1 parent a58d71c commit bcb3960

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/apps/grant/background.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -992,9 +992,13 @@ export class BackgroundGrant {
992992
listener: () => {
993993
document.body.appendChild(BackgroundGrant.textarea);
994994
document.addEventListener('copy', (e: ClipboardEvent) => {
995+
if (!BackgroundGrant.clipboardData) {
996+
return;
997+
}
995998
e.preventDefault();
996999
let { type, data } = BackgroundGrant.clipboardData;
9971000
(<any>e).clipboardData.setData(type || 'text/plain', data);
1001+
BackgroundGrant.clipboardData = undefined;
9981002
})
9991003
}
10001004
})

0 commit comments

Comments
 (0)