Skip to content

Commit

Permalink
[sitecore-jss] Make it clear that isEditorActive only works in browser (
Browse files Browse the repository at this point in the history
  • Loading branch information
illiakovalenko authored Jul 5, 2022
1 parent 92a7fef commit 0c848b7
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion packages/sitecore-jss/src/utils/editing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@ type ExtendedWindow = Window &
* Static utility class for Sitecore Experience Editor
*/
export class ExperienceEditor {
/**
* Determines whether the current execution context is within a Experience Editor.
* Experience Editor environment can be identified only in the browser
* @returns true if executing within a Experience Editor
*/
static isActive(): boolean {
if (isServer()) {
return false;
Expand Down Expand Up @@ -43,6 +48,11 @@ export const ChromeRediscoveryGlobalFunctionName = {
* Static utility class for Sitecore Horizon Editor
*/
export class HorizonEditor {
/**
* Determines whether the current execution context is within a Horizon Editor.
* Horizon Editor environment can be identified only in the browser
* @returns true if executing within a Horizon Editor
*/
static isActive(): boolean {
if (isServer()) {
return false;
Expand All @@ -61,7 +71,8 @@ export class HorizonEditor {
}

/**
* Determines whether the current execution context is within a Sitecore editor
* Determines whether the current execution context is within a Sitecore editor.
* Sitecore Editor environment can be identified only in the browser
* @returns true if executing within a Sitecore editor
*/
export const isEditorActive = (): boolean => {
Expand Down

0 comments on commit 0c848b7

Please sign in to comment.