Skip to content

Commit

Permalink
Open when getting rendered only if we need
Browse files Browse the repository at this point in the history
  • Loading branch information
Omry Zobel authored and DvirMalka committed Oct 31, 2022
1 parent 891c237 commit 86155d2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/modules/listeners/listeners.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,9 @@ function onHostEventHandler(ev: MessageEvent<unknown>): void {
Logger.info('Panel rendered message received');
sessionManager.setSessionValue('isRendered', true);

window.Strigo?.expandPanel();
if (sessionManager.shouldPanelBeOpen()) {
window.Strigo?.expandPanel();
}

break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/strigo/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ class StrigoSDK implements IStrigoSDK {
init(): void {
try {
Logger.info('Initializing SDK...');
sessionManager.setSessionValue('shouldPanelBeOpen', true);

if (this.config.initialized) {
Logger.info('SDK was already initialized');
Expand Down Expand Up @@ -152,7 +153,6 @@ class StrigoSDK implements IStrigoSDK {
this.open();

// Collapse the panel so it would open when fully loaded
sessionManager.setSessionValue('shouldPanelBeOpen', false);
this.collapse();
}
} catch (err) {
Expand Down

0 comments on commit 86155d2

Please sign in to comment.