mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-12 20:18:41 -09:00
Handle undefined focusedWindow in help menu item click (Report Issue)
This commit is contained in:
parent
d6cb7e930b
commit
d01a4a8897
1 changed files with 13 additions and 8 deletions
|
|
@ -58,7 +58,18 @@ ${JSON.stringify(getPlugins(), null, 2)}
|
|||
</details>`;
|
||||
|
||||
const issueURL = `https://github.com/zeit/hyper/issues/new?body=${encodeURIComponent(body)}`;
|
||||
if (issueURL.length > 6144) {
|
||||
const copyAndSend = () => {
|
||||
clipboard.writeText(body);
|
||||
shell.openExternal(
|
||||
`https://github.com/zeit/hyper/issues/new?body=${encodeURIComponent(
|
||||
'<!-- We have written the needed data into your clipboard because it was too large to send. ' +
|
||||
'Please paste. -->\n'
|
||||
)}`
|
||||
);
|
||||
};
|
||||
if (!focusedWindow) {
|
||||
copyAndSend();
|
||||
} else if (issueURL.length > 6144) {
|
||||
dialog
|
||||
.showMessageBox(focusedWindow, {
|
||||
message:
|
||||
|
|
@ -69,13 +80,7 @@ ${JSON.stringify(getPlugins(), null, 2)}
|
|||
})
|
||||
.then((result) => {
|
||||
if (result.response === 0) {
|
||||
clipboard.writeText(body);
|
||||
shell.openExternal(
|
||||
`https://github.com/zeit/hyper/issues/new?body=${encodeURIComponent(
|
||||
'<!-- We have written the needed data into your clipboard because it was too large to send. ' +
|
||||
'Please paste. -->\n'
|
||||
)}`
|
||||
);
|
||||
copyAndSend();
|
||||
}
|
||||
});
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue