Skip to content

Commit 6543ae1

Browse files
authored
Merge pull request #3 from aha-app/ACT-31-fix-double-call-destroy-applicationcontroller
ACT-31: Fix double call to destroy in ApplicationController
2 parents 702751e + 5cdca14 commit 6543ae1

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@aha-app/mvc",
3-
"version": "0.11.1",
3+
"version": "0.11.2",
44
"description": "Simple MVC framework using React for the view and GraphQL for the models.",
55
"main": "dist/index.js",
66
"type": "module",

src/controller/ApplicationController.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,10 @@ class ApplicationController<
146146
*/
147147
destroy() {}
148148

149+
/**
150+
* Internal destroy function. Do not override
151+
* @private
152+
*/
149153
internalDestroy() {
150154
this.destroy();
151155
}
@@ -326,7 +330,6 @@ function Controller<Props = {}>({
326330
useEffect(() => {
327331
return () => {
328332
debug('Destroying controller');
329-
if (controller.destroy) controller.destroy();
330333
controller.internalDestroy();
331334
};
332335
}, [controller]);

0 commit comments

Comments
 (0)