diff --git a/demo/main.js b/demo/main.js index 857e5845e..6990d1988 100644 --- a/demo/main.js +++ b/demo/main.js @@ -189,6 +189,12 @@ class Demo extends Component { inputFiles[images[i]] = { imageSrc }; } await this.initiateConnection(inputFiles); + stores.resetStores(); + stores.inject(NotificationStore, { + notifyUser: this.notifyUser, + raiseError: this.raiseError, + askConfirmation: this.askConfirmation, + }); this.state.key = this.state.key + 1; // note : the onchange won't be called if we cancel the dialog w/o selecting a file, so this won't be called. diff --git a/src/store_engine/dependency_container.ts b/src/store_engine/dependency_container.ts index defc9ea6b..57ede2d21 100644 --- a/src/store_engine/dependency_container.ts +++ b/src/store_engine/dependency_container.ts @@ -32,6 +32,10 @@ export class DependencyContainer { instantiate(Store: StoreConstructor, ...args: StoreParams>): T { return this.factory.build(Store, ...args); } + + resetStores() { + this.dependencies.clear(); + } } class StoreFactory {