Skip to content

Commit

Permalink
CB-4740 fix: sql editor mode detection
Browse files Browse the repository at this point in the history
  • Loading branch information
Wroud committed Feb 26, 2024
1 parent 43e82ed commit 0cdf4a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -239,10 +239,10 @@ export abstract class BaseSqlDataSource implements ISqlDataSource {

const scriptLength = this.script.length;

this.innerCursorState = {
this.innerCursorState = Object.freeze({
begin: Math.min(begin, scriptLength),
end: Math.min(end, scriptLength),
};
});
this.onUpdate.execute();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* Licensed under the Apache License, Version 2.0.
* you may not use this file except in compliance with the License.
*/
import { action, autorun, computed, IReactionDisposer, observable, untracked } from 'mobx';
import { action, autorun, computed, IReactionDisposer, observable, runInAction, untracked } from 'mobx';
import { useEffect } from 'react';

import { ConfirmationDialog, useExecutor, useObservableRef } from '@cloudbeaver/core-blocks';
Expand Down Expand Up @@ -538,7 +538,7 @@ export function useSqlEditor(state: ISqlEditorTabState): ISQLEditorData {
const contexts = data.onMode.execute(data);
const activeSegmentMode = contexts.getContext(SQLEditorModeContext);

action(() => {
runInAction(() => {
data.activeSegmentMode = activeSegmentMode;
});
});
Expand Down

0 comments on commit 0cdf4a8

Please sign in to comment.