Make existing and new issue URLs configurable (#10710)
* Make existing and new issue URLs configurable * Apply a deep merge over sdk config to allow sane nested structures * Defaultize * Fix types * Iterate * Add FeedbackDialog snapshot test * Add SdkConfig snapshot tests * Iterate * Fix tests * Iterate types * Fix test
This commit is contained in:
parent
e4610e4672
commit
6166dbb661
23 changed files with 259 additions and 78 deletions
|
@ -18,6 +18,7 @@ import { MatrixClient } from "matrix-js-sdk/src/client";
|
|||
|
||||
import BasePlatform from "../../BasePlatform";
|
||||
import { IConfigOptions } from "../../IConfigOptions";
|
||||
import { DeepReadonly } from "../../@types/common";
|
||||
|
||||
export type DeviceClientInformation = {
|
||||
name?: string;
|
||||
|
@ -49,7 +50,7 @@ export const getClientInformationEventType = (deviceId: string): string => `${cl
|
|||
*/
|
||||
export const recordClientInformation = async (
|
||||
matrixClient: MatrixClient,
|
||||
sdkConfig: IConfigOptions,
|
||||
sdkConfig: DeepReadonly<IConfigOptions>,
|
||||
platform?: BasePlatform,
|
||||
): Promise<void> => {
|
||||
const deviceId = matrixClient.getDeviceId()!;
|
||||
|
|
|
@ -141,3 +141,12 @@ export function objectKeyChanges<O extends {}>(a: O, b: O): (keyof O)[] {
|
|||
export function objectClone<O extends {}>(obj: O): O {
|
||||
return JSON.parse(JSON.stringify(obj));
|
||||
}
|
||||
|
||||
/**
|
||||
* Simple object check.
|
||||
* @param item
|
||||
* @returns {boolean}
|
||||
*/
|
||||
export function isObject(item: any): item is object {
|
||||
return item && typeof item === "object" && !Array.isArray(item);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue