File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -45,6 +45,7 @@ import ModuleApi from "../modules/Api";
45
45
import { TextualEventViewModel } from "../viewmodels/event-tiles/TextualEventViewModel" ;
46
46
import { TextualEventView } from "../shared-components/event-tiles/TextualEventView" ;
47
47
import { ElementCallEventType } from "../call-types" ;
48
+ import { useAutoDisposedViewModel } from "../viewmodels/base/useAutoDisposedViewModel" ;
48
49
49
50
// Subset of EventTile's IProps plus some mixins
50
51
export interface EventTileTypeProps
@@ -79,10 +80,15 @@ const LegacyCallEventFactory: Factory<FactoryProps & { callEventGrouper: LegacyC
79
80
< LegacyCallEvent ref = { ref } { ...props } />
80
81
) ;
81
82
const CallEventFactory : Factory = ( ref , props ) => < CallEvent ref = { ref } { ...props } /> ;
82
- export const TextualEventFactory : Factory = ( ref , props ) => {
83
- const vm = new TextualEventViewModel ( props ) ;
83
+
84
+ const TextualEventComponent : React . FC < FactoryProps > = ( props ) => {
85
+ const vm = useAutoDisposedViewModel ( ( ) => new TextualEventViewModel ( props ) ) ;
84
86
return < TextualEventView vm = { vm } /> ;
85
87
} ;
88
+ export const TextualEventFactory : Factory = ( ref , props ) => {
89
+ return < TextualEventComponent { ...props } /> ;
90
+ } ;
91
+
86
92
const VerificationReqFactory : Factory = ( _ref , props ) => < MKeyVerificationRequest { ...props } /> ;
87
93
const HiddenEventFactory : Factory = ( ref , props ) => < HiddenBody ref = { ref } { ...props } /> ;
88
94
You can’t perform that action at this time.
0 commit comments