mirror of
https://github.com/matrix-org/matrix-hookshot.git
synced 2025-03-10 13:17:08 +00:00

* Fix widget client only talking to localhost * Improve error text around widget communication. * changelog * Remove unused. * Simplify code by using a context for bridge API.
16 lines
337 B
TypeScript
16 lines
337 B
TypeScript
import { createContext } from "preact";
|
|
import type { BridgeAPI } from "./BridgeAPI";
|
|
|
|
interface IBridgeContext {
|
|
bridgeApi: BridgeAPI;
|
|
}
|
|
|
|
const fakeBridgeContext = {
|
|
get bridgeApi(): BridgeAPI {
|
|
throw Error('No context provided');
|
|
}
|
|
}
|
|
|
|
export const BridgeContext = createContext<IBridgeContext>(fakeBridgeContext);
|
|
|