Skip to content

Commit

Permalink
fix: #739 correcr logic before restore window.__REAPIT_MARKETPLACE_GL…
Browse files Browse the repository at this point in the history
…OBALS__ (#809)
  • Loading branch information
Cuong Vu authored Apr 3, 2020
1 parent 490f0b1 commit f9d7f3a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions packages/elements/src/components/DynamicLinks/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ export const injectSwitchModeToWindow = () => {
// Only restore if window[GLOBAL_KEY] is writable
// In REAL DESKTOP mode, window.__REAPIT_MARKETPLACE_GLOBALS__ writable is false
// and this function will not be executed
if (Object.getOwnPropertyDescriptor(window, GLOBAL_KEY)?.writable) {
restoreGlobalObjectFromLS()
if (Object.getOwnPropertyDescriptor(window, GLOBAL_KEY)?.writable === false) {
return
}
restoreGlobalObjectFromLS()
}

0 comments on commit f9d7f3a

Please sign in to comment.