-
-
Notifications
You must be signed in to change notification settings - Fork 908
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
39 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,4 +64,4 @@ export class App extends Component { | |
/> | ||
); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,18 @@ | ||
export function extractQueryParams(param: string) { | ||
return new URLSearchParams(window.location.search).get(param) as string; | ||
} | ||
import type { ClientOptions } from '.'; | ||
|
||
export const BOOLEAN_CLIENT_OPTION_PROPS: Array<keyof ClientOptions> = [ | ||
'disableLeaveAlert', | ||
'disableResizeOverlay', | ||
'enableZmodem', | ||
'enableTrzsz', | ||
'enableSixel', | ||
'rendererType', | ||
]; | ||
|
||
export const STRING_CLIENT_OPTION_PROPS: Array<keyof ClientOptions> = ['rendererType', 'unicodeVersion']; | ||
|
||
const TRUE_PARAMS = ['true', '1']; | ||
export const CLIENT_OPTION_PROPS = [...BOOLEAN_CLIENT_OPTION_PROPS, ...STRING_CLIENT_OPTION_PROPS]; | ||
|
||
export function isQueryOptionEnabled(param: string): boolean { | ||
return TRUE_PARAMS.includes(extractQueryParams(param)); | ||
export function extractQueryParams(param: keyof ClientOptions) { | ||
return new URLSearchParams(window.location.search).get(param) as ClientOptions[typeof param]; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters