fix: change runtime.onMessage to async fn

This commit is contained in:
Gabe Yuan
2024-03-19 17:28:07 +08:00
parent 54a6189b0c
commit 1d9e9c1b7d
5 changed files with 57 additions and 109 deletions

View File

@@ -119,11 +119,9 @@ export default function Popup({ setShowPopup, translator: tran }) {
const commands = {};
if (isExt) {
const res = await sendBgMsg(MSG_COMMAND_SHORTCUTS);
if (!res.error) {
res.data.forEach(({ name, shortcut }) => {
commands[name] = shortcut;
});
}
res.forEach(({ name, shortcut }) => {
commands[name] = shortcut;
});
} else {
const shortcuts = tran.setting.shortcuts;
if (shortcuts) {