mirror of
https://github.com/gchq/CyberChef
synced 2025-01-08 10:38:46 +00:00
Correctly handle clicking cancel on go to dialog
This commit is contained in:
parent
f55102716e
commit
15b5cf7c20
2 changed files with 11 additions and 3 deletions
|
@ -1381,7 +1381,11 @@ class InputWaiter {
|
|||
*/
|
||||
async goToTab() {
|
||||
const inputNums = await this.getInputNums();
|
||||
const tabNum = parseInt(window.prompt(`Enter tab number (${inputNums.min} - ${inputNums.max}):`, this.getActiveTab().toString()), 10);
|
||||
let tabNum = window.prompt(`Enter tab number (${inputNums.min} - ${inputNums.max}):`, this.getActiveTab().toString());
|
||||
|
||||
if (tabNum === null) return;
|
||||
tabNum = parseInt(tabNum, 10);
|
||||
|
||||
this.changeTab(tabNum, this.app.options.syncTabs);
|
||||
}
|
||||
|
||||
|
|
|
@ -797,8 +797,12 @@ class OutputWaiter {
|
|||
*/
|
||||
goToTab() {
|
||||
const min = this.getSmallestInputNum(),
|
||||
max = this.getLargestInputNum(),
|
||||
tabNum = parseInt(window.prompt(`Enter tab number (${min} - ${max}):`, this.getActiveTab().toString()), 10);
|
||||
max = this.getLargestInputNum();
|
||||
|
||||
let tabNum = window.prompt(`Enter tab number (${min} - ${max}):`, this.getActiveTab().toString());
|
||||
if (tabNum === null) return;
|
||||
tabNum = parseInt(tabNum, 10);
|
||||
|
||||
if (this.outputExists(tabNum)) {
|
||||
this.changeTab(tabNum, this.app.options.syncTabs);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue