Improve speed of changing input tabs.
Handle not finding an active tab
This commit is contained in:
parent
c2087f6d5f
commit
97f86af6b9
@ -947,7 +947,8 @@ class InputWaiter {
|
|||||||
* @param {boolean} [changeOutput=false] - If true, also changes the output
|
* @param {boolean} [changeOutput=false] - If true, also changes the output
|
||||||
*/
|
*/
|
||||||
changeTab(inputNum, changeOutput) {
|
changeTab(inputNum, changeOutput) {
|
||||||
if (this.manager.tabs.changeInputTab(inputNum)) {
|
if (this.manager.tabs.getInputTabItem(inputNum) !== null) {
|
||||||
|
this.manager.tabs.changeInputTab(inputNum);
|
||||||
this.inputWorker.postMessage({
|
this.inputWorker.postMessage({
|
||||||
action: "setInput",
|
action: "setInput",
|
||||||
data: {
|
data: {
|
||||||
@ -1245,6 +1246,7 @@ class InputWaiter {
|
|||||||
*/
|
*/
|
||||||
changeTabRight() {
|
changeTabRight() {
|
||||||
const activeTab = this.manager.tabs.getActiveInputTab();
|
const activeTab = this.manager.tabs.getActiveInputTab();
|
||||||
|
if (activeTab === -1) return;
|
||||||
this.inputWorker.postMessage({
|
this.inputWorker.postMessage({
|
||||||
action: "changeTabRight",
|
action: "changeTabRight",
|
||||||
data: {
|
data: {
|
||||||
@ -1258,6 +1260,7 @@ class InputWaiter {
|
|||||||
*/
|
*/
|
||||||
changeTabLeft() {
|
changeTabLeft() {
|
||||||
const activeTab = this.manager.tabs.getActiveInputTab();
|
const activeTab = this.manager.tabs.getActiveInputTab();
|
||||||
|
if (activeTab === -1) return;
|
||||||
this.inputWorker.postMessage({
|
this.inputWorker.postMessage({
|
||||||
action: "changeTabLeft",
|
action: "changeTabLeft",
|
||||||
data: {
|
data: {
|
||||||
|
@ -288,8 +288,6 @@ class TabWaiter {
|
|||||||
} else {
|
} else {
|
||||||
this.hideTabBar();
|
this.hideTabBar();
|
||||||
}
|
}
|
||||||
|
|
||||||
this.changeTab(activeTab, io);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user