@@ -32,6 +32,7 @@ import {
3232 _getByteLen ,
3333 _getClipboardText ,
3434 _getSelection ,
35+ _hash ,
3536 _html ,
3637 _isEmpty ,
3738 _isPad ,
@@ -43,12 +44,11 @@ import {
4344 _parsePixelFromValue ,
4445 _pointInRect ,
4546 _screenType ,
46- _hash ,
4747} from " ~/common/util.ts" ;
48- import api , {getOptions , register , rename , unregister } from " ~/common/api" ;
48+ import api , {getConfiguration , register , rename , unregister } from " ~/common/api" ;
4949import {DEFAULT_COMMANDS , WINDOW_STYLE } from " ~/common/configuration.ts" ;
5050import {_parseANSI } from " ~/ansi" ;
51- import store from " ~/common/store" ;
51+ import { getStore } from " ~/common/store" ;
5252import THeader from " ~/components/THeader.vue" ;
5353import TViewerNormal from " ~/components/TViewerNormal.vue" ;
5454import TViewerJson from " ~/components/TViewerJson.vue" ;
@@ -704,14 +704,14 @@ const getThemeStyleId = (salt: string): string => {
704704 * @param theme
705705 */
706706const setTheme = (theme : string ) => {
707- let customThemes = getOptions ().themes
708- let themeStyle
707+ let customThemes = getConfiguration ().themes
708+ let themeStyle: string
709709 if (customThemes && customThemes [theme ]) {
710710 themeStyle = customThemes [theme ]
711711 } else if (theme === ' dark' ) {
712- themeStyle = themeDark
712+ themeStyle = themeDark as string
713713 } else if (theme === ' light' ) {
714- themeStyle = themeLight
714+ themeStyle = themeLight as string
715715 } else {
716716 console .warn (" The specified terminal theme style was not found:" , theme )
717717 return
@@ -751,7 +751,7 @@ const changeThemeFlag = (newNameKey: string, oldNameKey: string) => {
751751
752752const _clearLog = (clearHistory : boolean ) => {
753753 if (clearHistory ) {
754- store .clear (getName ())
754+ getStore () .clear (getName ())
755755 } else {
756756 terminalLog .value = [];
757757 logSize .value = 0 ;
@@ -1304,7 +1304,7 @@ const _jumpToBottom = (enforce: boolean = false) => {
13041304const _saveCurCommand = () => {
13051305 let cmd = command .value = command .value .trim ()
13061306 if (cmd .length > 0 ) {
1307- store .push (getName (), cmd )
1307+ getStore () .push (getName (), cmd )
13081308 }
13091309
13101310 let group = _newTerminalLogGroup ()
@@ -1455,21 +1455,21 @@ const _switchTipsSelectedIdx = (idx: number) => {
14551455}
14561456
14571457const _switchPreCmd = () => {
1458- let cmdLog = store .getLog (getName ())
1459- let cmdIdx = store .getIdx (getName ())
1458+ let cmdLog = getStore () .getLog (getName ())
1459+ let cmdIdx = getStore () .getIdx (getName ())
14601460 if (cmdLog .length !== 0 && cmdIdx > 0 ) {
14611461 cmdIdx -= 1 ;
14621462 command .value = cmdLog [cmdIdx ] ? cmdLog [cmdIdx ] : ' ' ;
14631463 }
14641464 _resetCursorPos ()
1465- store .setIdx (getName (), cmdIdx )
1465+ getStore () .setIdx (getName (), cmdIdx )
14661466 _searchCmd ()
14671467 _jumpToBottom (true )
14681468}
14691469
14701470const _switchNextCmd = () => {
1471- let cmdLog = store .getLog (getName ())
1472- let cmdIdx = store .getIdx (getName ())
1471+ let cmdLog = getStore () .getLog (getName ())
1472+ let cmdIdx = getStore () .getIdx (getName ())
14731473 if (cmdLog .length !== 0 && cmdIdx < cmdLog .length - 1 ) {
14741474 cmdIdx += 1 ;
14751475 command .value = cmdLog [cmdIdx ] ? cmdLog [cmdIdx ] : ' ' ;
@@ -1478,7 +1478,7 @@ const _switchNextCmd = () => {
14781478 command .value = ' ' ;
14791479 }
14801480 _resetCursorPos ()
1481- store .setIdx (getName (), cmdIdx )
1481+ getStore () .setIdx (getName (), cmdIdx )
14821482 _searchCmd ()
14831483 _jumpToBottom (true )
14841484}
0 commit comments