Skip to content

Commit

Permalink
Make queueOfDialogs a non-observable array to fix crash in umd build …
Browse files Browse the repository at this point in the history
…from embedded apps (#2469)


Co-authored-by: Colin Diesh <colin.diesh@gmail.com>
  • Loading branch information
garrettjstevens and cmdcolin committed Nov 1, 2021
1 parent a9e7f59 commit d7ce8d6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default function sessionModelFactory(pluginManager: PluginManager) {
*/
task: undefined,

queueOfDialogs: observable.array([] as [DialogComponentType, any][]),
queueOfDialogs: [] as [DialogComponentType, any][],
}))
.views(self => ({
get DialogComponent() {
Expand Down Expand Up @@ -150,9 +150,12 @@ export default function sessionModelFactory(pluginManager: PluginManager) {
callback: (doneCallback: Function) => [DialogComponentType, any],
): void {
const [component, props] = callback(() => {
self.queueOfDialogs.shift()
this.removeActiveDialog()
})
self.queueOfDialogs.push([component, props])
self.queueOfDialogs = [...self.queueOfDialogs, [component, props]]
},
removeActiveDialog() {
self.queueOfDialogs = self.queueOfDialogs.slice(1)
},
makeConnection(
configuration: AnyConfigurationModel,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default function sessionModelFactory(pluginManager: PluginManager) {
*/
task: undefined,

queueOfDialogs: observable.array([] as [DialogComponentType, any][]),
queueOfDialogs: [] as [DialogComponentType, any][],
}))
.views(self => ({
get DialogComponent() {
Expand Down Expand Up @@ -155,9 +155,12 @@ export default function sessionModelFactory(pluginManager: PluginManager) {
callback: (doneCallback: Function) => [DialogComponentType, any],
): void {
const [component, props] = callback(() => {
self.queueOfDialogs.shift()
this.removeActiveDialog()
})
self.queueOfDialogs.push([component, props])
self.queueOfDialogs = [...self.queueOfDialogs, [component, props]]
},
removeActiveDialog() {
self.queueOfDialogs = self.queueOfDialogs.slice(1)
},
makeConnection(
configuration: AnyConfigurationModel,
Expand Down

0 comments on commit d7ce8d6

Please sign in to comment.