mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-01 13:13:58 +00:00
#294 fixed statusbar doesn't match active tab
This commit is contained in:
@@ -8,14 +8,17 @@ let lastCurrentTab = null;
|
|||||||
openedTabs.subscribe(value => {
|
openedTabs.subscribe(value => {
|
||||||
const newCurrentTab = (value || []).find(x => x.selected);
|
const newCurrentTab = (value || []).find(x => x.selected);
|
||||||
if (newCurrentTab == lastCurrentTab) return;
|
if (newCurrentTab == lastCurrentTab) return;
|
||||||
if (lastCurrentTab?.tabComponent == 'ConnectionTab') return;
|
|
||||||
|
const lastTab = lastCurrentTab;
|
||||||
|
lastCurrentTab = newCurrentTab;
|
||||||
|
if (lastTab?.tabComponent == 'ConnectionTab') return;
|
||||||
|
|
||||||
if (newCurrentTab) {
|
if (newCurrentTab) {
|
||||||
const { conid, database } = newCurrentTab.props || {};
|
const { conid, database } = newCurrentTab.props || {};
|
||||||
if (
|
if (
|
||||||
conid &&
|
conid &&
|
||||||
database &&
|
database &&
|
||||||
(conid != _.get(lastCurrentTab, 'props.conid') || database != _.get(lastCurrentTab, 'props.database'))
|
(conid != _.get(lastTab, 'props.conid') || database != _.get(lastTab, 'props.database'))
|
||||||
) {
|
) {
|
||||||
const doWork = async () => {
|
const doWork = async () => {
|
||||||
const connection = await getConnectionInfo({ conid });
|
const connection = await getConnectionInfo({ conid });
|
||||||
@@ -27,6 +30,4 @@ openedTabs.subscribe(value => {
|
|||||||
callWhenAppLoaded(doWork);
|
callWhenAppLoaded(doWork);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
lastCurrentTab = newCurrentTab;
|
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user