address isssues for pull request

This commit is contained in:
Áron Hegymegi-Kiss
2022-01-09 21:28:30 +01:00
parent ed17d4859f
commit 83db64d084
9 changed files with 327 additions and 224 deletions

View File

@@ -53,9 +53,9 @@ class KeybindComponent extends React.Component<KeybindProps, KeybindState> {
}
openEditDialog(): void {
dialog = document.createElement("div");
dialog = parent.document.createElement("div");
dialog.id = "keybind-dialog";
document.body.prepend(dialog);
parent.document.body.prepend(dialog);
ReactDOM.render(<KeybindDialogComponent option={this.props.option} closeListener={(updateWith) => this.closeEditDialog(updateWith)} />, dialog);
}

View File

@@ -76,10 +76,12 @@ class KeybindDialogComponent extends React.Component<KeybindDialogProps, Keybind
}
componentDidMount(): void {
parent.document.addEventListener("keydown", this.keybindKeyPressed);
document.addEventListener("keydown", this.keybindKeyPressed);
}
componentWillUnmount(): void {
parent.document.removeEventListener("keydown", this.keybindKeyPressed);
document.removeEventListener("keydown", this.keybindKeyPressed);
}

View File

@@ -371,7 +371,7 @@ class SponsorTimeEditComponent extends React.Component<SponsorTimeEditProps, Spo
if (confirm(chrome.i18n.getMessage("enableThisCategoryFirst")
.replace("{0}", chrome.i18n.getMessage("category_" + chosenCategory)))) {
// Open options page
chrome.runtime.sendMessage({message: "openConfig", hash: "segments"});
chrome.runtime.sendMessage({message: "openConfig", hash: "behavior"});
}
return;