mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-10-31 16:23:03 +00:00
revert: drop in-tree WidgetPermissionCustomisations (handled by plugin)
HealthChat's preapproveCapabilities customisation returned undefined for non-HealthChat widgets, which short-circuits master's reworked validateCapabilities flow (it falls back to the customisation whenever it is defined). The api.healthchat.ch auto-approval is handled by the plugin, so restore the empty upstream customisations object.
This commit is contained in:
@@ -13,18 +13,4 @@ import type { WidgetPermissionsCustomisations } from "@element-hq/element-web-mo
|
||||
|
||||
// A real customisation module will define and export one or more of the
|
||||
// customisation points that make up the interface above.
|
||||
export const WidgetPermissionCustomisations: WidgetPermissionsCustomisations<Widget, Capability> = {
|
||||
// Automatically approve all capabilities for widgets from api.healthchat.ch domain
|
||||
preapproveCapabilities: async (
|
||||
widget: Widget,
|
||||
requestedCapabilities: Set<Capability>,
|
||||
): Promise<Set<Capability>> => {
|
||||
// Check if the widget URL contains api.healthchat.ch
|
||||
if (widget.templateUrl?.includes("api.healthchat.ch")) {
|
||||
// Return all requested capabilities as approved
|
||||
return new Set(requestedCapabilities);
|
||||
}
|
||||
// Return undefined to fall back to default behavior for other widgets
|
||||
return undefined as any;
|
||||
},
|
||||
};
|
||||
export const WidgetPermissionCustomisations: WidgetPermissionsCustomisations<Widget, Capability> = {};
|
||||
|
||||
Reference in New Issue
Block a user