mirror of
https://github.com/Novaloop-AG/healthchat-web.git
synced 2026-11-11 02:38:39 +00:00
Remove dependency on uuid (#33230)
* Remove dependency on `uuid` * Delint
This commit is contained in:
committed by
GitHub
parent
86ea6bd6b9
commit
354a05d89f
@@ -104,7 +104,6 @@
|
|||||||
"sanitize-html": "2.17.3",
|
"sanitize-html": "2.17.3",
|
||||||
"tar-js": "^0.3.0",
|
"tar-js": "^0.3.0",
|
||||||
"ua-parser-js": "1.0.40",
|
"ua-parser-js": "1.0.40",
|
||||||
"uuid": "^13.0.0",
|
|
||||||
"what-input": "^5.2.10"
|
"what-input": "^5.2.10"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import React, { type ChangeEvent, useContext, useEffect, useMemo, useState } fro
|
|||||||
import { Pill } from "@element-hq/web-shared-components";
|
import { Pill } from "@element-hq/web-shared-components";
|
||||||
import { MatrixEvent, type IContent, RoomStickyEventsEvent } from "matrix-js-sdk/src/matrix";
|
import { MatrixEvent, type IContent, RoomStickyEventsEvent } from "matrix-js-sdk/src/matrix";
|
||||||
import { Alert, Form, SettingsToggleInput } from "@vector-im/compound-web";
|
import { Alert, Form, SettingsToggleInput } from "@vector-im/compound-web";
|
||||||
import { v4 as uuidv4 } from "uuid";
|
|
||||||
|
|
||||||
import BaseTool, { DevtoolsContext, type IDevtoolsProps } from "./BaseTool.tsx";
|
import BaseTool, { DevtoolsContext, type IDevtoolsProps } from "./BaseTool.tsx";
|
||||||
import { _t, _td, UserFriendlyError } from "../../../../languageHandler.tsx";
|
import { _t, _td, UserFriendlyError } from "../../../../languageHandler.tsx";
|
||||||
@@ -330,7 +329,7 @@ export const StickyEventEditor: React.FC<IEditorProps> = ({ mxEvent, onBack }) =
|
|||||||
const defaultContent = mxEvent
|
const defaultContent = mxEvent
|
||||||
? stringify(mxEvent.getContent())
|
? stringify(mxEvent.getContent())
|
||||||
: stringify({
|
: stringify({
|
||||||
msc4354_sticky_key: uuidv4(),
|
msc4354_sticky_key: window.crypto.randomUUID(),
|
||||||
});
|
});
|
||||||
return <EventEditor fieldDefs={fields} defaultContent={defaultContent} onSend={onSend} onBack={onBack} />;
|
return <EventEditor fieldDefs={fields} defaultContent={defaultContent} onSend={onSend} onBack={onBack} />;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -5,8 +5,6 @@
|
|||||||
* Please see LICENSE files in the repository root for full details.
|
* Please see LICENSE files in the repository root for full details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
import { v4 as uuidv4 } from "uuid";
|
|
||||||
|
|
||||||
import { SettingLevel } from "../../settings/SettingLevel";
|
import { SettingLevel } from "../../settings/SettingLevel";
|
||||||
import SettingsStore from "../../settings/SettingsStore";
|
import SettingsStore from "../../settings/SettingsStore";
|
||||||
import Modal from "../../Modal";
|
import Modal from "../../Modal";
|
||||||
@@ -43,7 +41,7 @@ export async function createSection(): Promise<boolean> {
|
|||||||
const [shouldCreateSection, sectionName] = await modal.finished;
|
const [shouldCreateSection, sectionName] = await modal.finished;
|
||||||
if (!shouldCreateSection || !sectionName) return false;
|
if (!shouldCreateSection || !sectionName) return false;
|
||||||
|
|
||||||
const tag = `element.io.section.${uuidv4()}`;
|
const tag = `element.io.section.${window.crypto.randomUUID()}`;
|
||||||
const newSection: CustomSection = { tag, name: sectionName };
|
const newSection: CustomSection = { tag, name: sectionName };
|
||||||
|
|
||||||
// Save the new section data
|
// Save the new section data
|
||||||
|
|||||||
@@ -7,7 +7,6 @@ Please see LICENSE files in the repository root for full details.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { logger } from "matrix-js-sdk/src/logger";
|
import { logger } from "matrix-js-sdk/src/logger";
|
||||||
import { v4 as uuidv4 } from "uuid";
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Functionality for checking that only one instance is running at once
|
* Functionality for checking that only one instance is running at once
|
||||||
@@ -107,7 +106,7 @@ export function checkSessionLockFree(): boolean {
|
|||||||
*/
|
*/
|
||||||
export async function getSessionLock(onNewInstance: () => Promise<void>): Promise<boolean> {
|
export async function getSessionLock(onNewInstance: () => Promise<void>): Promise<boolean> {
|
||||||
/** unique ID for this session */
|
/** unique ID for this session */
|
||||||
const sessionIdentifier = uuidv4();
|
const sessionIdentifier = window.crypto.randomUUID();
|
||||||
|
|
||||||
const prefixedLogger = logger.getChild(`getSessionLock[${sessionIdentifier}]`);
|
const prefixedLogger = logger.getChild(`getSessionLock[${sessionIdentifier}]`);
|
||||||
|
|
||||||
|
|||||||
@@ -253,8 +253,6 @@ describe("SessionLock", () => {
|
|||||||
|
|
||||||
// import the dependencies of getSessionLock into the new context
|
// import the dependencies of getSessionLock into the new context
|
||||||
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
||||||
window2._uuid = require("uuid");
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
||||||
window2._logger = require("matrix-js-sdk/src/logger");
|
window2._logger = require("matrix-js-sdk/src/logger");
|
||||||
window2.SESSION_LOCK_CONSTANTS = SESSION_LOCK_CONSTANTS;
|
window2.SESSION_LOCK_CONSTANTS = SESSION_LOCK_CONSTANTS;
|
||||||
|
|
||||||
|
|||||||
Generated
-3
@@ -509,9 +509,6 @@ importers:
|
|||||||
ua-parser-js:
|
ua-parser-js:
|
||||||
specifier: 1.0.40
|
specifier: 1.0.40
|
||||||
version: 1.0.40
|
version: 1.0.40
|
||||||
uuid:
|
|
||||||
specifier: ^13.0.0
|
|
||||||
version: 13.0.0
|
|
||||||
what-input:
|
what-input:
|
||||||
specifier: ^5.2.10
|
specifier: ^5.2.10
|
||||||
version: 5.2.12
|
version: 5.2.12
|
||||||
|
|||||||
Reference in New Issue
Block a user