mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
Throw if viewClass returns undefined
This commit is contained in:
parent
b134fa7409
commit
273c44424f
@ -24,9 +24,11 @@ export class ReplyPreviewView extends TemplateView {
|
||||
}
|
||||
|
||||
_renderReplyPreview(t, vm) {
|
||||
// todo: this should probably be called viewClassForTile instead
|
||||
const viewClass = viewClassForEntry(vm);
|
||||
const view = new viewClass(vm, { reply: true, interactive: false });
|
||||
if (!view) {
|
||||
throw new Error(`Shape ${vm.shape} is unrecognized.`)
|
||||
}
|
||||
const rendered = t.view(view);
|
||||
return this._renderReplyHeader(t, vm, [rendered]);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user