mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-13 04:28: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>`;
|
</details>`;
|
||||||
|
|
||||||
const issueURL = `https://github.com/zeit/hyper/issues/new?body=${encodeURIComponent(body)}`;
|
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
|
dialog
|
||||||
.showMessageBox(focusedWindow, {
|
.showMessageBox(focusedWindow, {
|
||||||
message:
|
message:
|
||||||
|
|
@ -69,13 +80,7 @@ ${JSON.stringify(getPlugins(), null, 2)}
|
||||||
})
|
})
|
||||||
.then((result) => {
|
.then((result) => {
|
||||||
if (result.response === 0) {
|
if (result.response === 0) {
|
||||||
clipboard.writeText(body);
|
copyAndSend();
|
||||||
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'
|
|
||||||
)}`
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue