Implement Left Panel User Widget
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
parent
f699be971e
commit
956a3bf69d
6 changed files with 315 additions and 3 deletions
|
@ -42,7 +42,7 @@ export interface IWidget {
|
|||
type: string;
|
||||
sender: string;
|
||||
state_key: string;
|
||||
content: IApp;
|
||||
content: Partial<IApp>;
|
||||
}
|
||||
|
||||
export default class WidgetUtils {
|
||||
|
@ -410,7 +410,7 @@ export default class WidgetUtils {
|
|||
return client.setAccountData('m.widgets', userWidgets);
|
||||
}
|
||||
|
||||
static makeAppConfig(appId: string, app: IApp, senderUserId: string, roomId: string | null, eventId: string): IApp {
|
||||
static makeAppConfig(appId: string, app: Partial<IApp>, senderUserId: string, roomId: string | null, eventId: string): IApp {
|
||||
if (!senderUserId) {
|
||||
throw new Error("Widgets must be created by someone - provide a senderUserId");
|
||||
}
|
||||
|
@ -421,7 +421,7 @@ export default class WidgetUtils {
|
|||
app.eventId = eventId;
|
||||
app.name = app.name || app.type;
|
||||
|
||||
return app;
|
||||
return app as IApp;
|
||||
}
|
||||
|
||||
static getCapWhitelistForAppTypeInRoomId(appType: string, roomId: string): Capability[] {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue