mirror of
https://github.com/gchq/CyberChef
synced 2025-01-09 02:58: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() {
|
async goToTab() {
|
||||||
const inputNums = await this.getInputNums();
|
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);
|
this.changeTab(tabNum, this.app.options.syncTabs);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -797,8 +797,12 @@ class OutputWaiter {
|
||||||
*/
|
*/
|
||||||
goToTab() {
|
goToTab() {
|
||||||
const min = this.getSmallestInputNum(),
|
const min = this.getSmallestInputNum(),
|
||||||
max = this.getLargestInputNum(),
|
max = this.getLargestInputNum();
|
||||||
tabNum = parseInt(window.prompt(`Enter tab number (${min} - ${max}):`, this.getActiveTab().toString()), 10);
|
|
||||||
|
let tabNum = window.prompt(`Enter tab number (${min} - ${max}):`, this.getActiveTab().toString());
|
||||||
|
if (tabNum === null) return;
|
||||||
|
tabNum = parseInt(tabNum, 10);
|
||||||
|
|
||||||
if (this.outputExists(tabNum)) {
|
if (this.outputExists(tabNum)) {
|
||||||
this.changeTab(tabNum, this.app.options.syncTabs);
|
this.changeTab(tabNum, this.app.options.syncTabs);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue