mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-21 15:16:01 +00:00
imrpoved closing inactive sessions
This commit is contained in:
@@ -80,8 +80,10 @@
|
||||
function onSession(sid) {
|
||||
if (sid) {
|
||||
apiOn(`session-done-${sid}`, handleSessionDone);
|
||||
apiOn(`session-closed-${sid}`, handleSessionClosed);
|
||||
return () => {
|
||||
apiOff(`session-done-${sid}`, handleSessionDone);
|
||||
apiOff(`session-closed-${sid}`, handleSessionClosed);
|
||||
};
|
||||
}
|
||||
return () => {};
|
||||
@@ -197,6 +199,11 @@
|
||||
timerLabel.stop();
|
||||
};
|
||||
|
||||
const handleSessionClosed = () => {
|
||||
sessionId = null;
|
||||
handleSessionDone();
|
||||
};
|
||||
|
||||
const handleChange = (value, skipUndoChain) =>
|
||||
// @ts-ignore
|
||||
dispatchModel({
|
||||
|
||||
@@ -125,8 +125,10 @@
|
||||
function onSession(sid) {
|
||||
if (sid) {
|
||||
apiOn(`session-done-${sid}`, handleSessionDone);
|
||||
apiOn(`session-closed-${sid}`, handleSessionClosed);
|
||||
return () => {
|
||||
apiOff(`session-done-${sid}`, handleSessionDone);
|
||||
apiOff(`session-closed-${sid}`, handleSessionClosed);
|
||||
};
|
||||
}
|
||||
return () => {};
|
||||
@@ -279,6 +281,11 @@
|
||||
timerLabel.stop();
|
||||
};
|
||||
|
||||
const handleSessionClosed = () => {
|
||||
sessionId = null;
|
||||
handleSessionDone();
|
||||
};
|
||||
|
||||
const { editorState, editorValue, setEditorData } = useEditorData({
|
||||
tabid,
|
||||
loadFromArgs:
|
||||
|
||||
Reference in New Issue
Block a user