feat: supply version param when installing libraries (#4305)

This commit is contained in:
David Luzar 2021-11-23 17:59:26 +01:00 committed by GitHub
parent b6ef953dc9
commit cc4b0c2932
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 23 additions and 8 deletions

View file

@ -21,6 +21,7 @@ import { ToolButton } from "./ToolButton";
import { Tooltip } from "./Tooltip";
import "./LibraryMenuItems.scss";
import { VERSIONS } from "../constants";
const LibraryMenuItems = ({
libraryItems,
@ -293,7 +294,9 @@ const LibraryMenuItems = ({
<a
href={`${process.env.REACT_APP_LIBRARY_URL}?target=${
window.name || "_blank"
}&referrer=${referrer}&useHash=true&token=${id}&theme=${theme}`}
}&referrer=${referrer}&useHash=true&token=${id}&theme=${theme}&version=${
VERSIONS.excalidrawLibrary
}`}
target="_excalidraw_libraries"
>
{t("labels.libraries")}

View file

@ -8,7 +8,7 @@ import { ToolButton } from "./ToolButton";
import { AppState, LibraryItems, LibraryItem } from "../types";
import { exportToBlob } from "../packages/utils";
import { EXPORT_DATA_TYPES, EXPORT_SOURCE } from "../constants";
import { EXPORT_DATA_TYPES, EXPORT_SOURCE, VERSIONS } from "../constants";
import { ExportedLibraryData } from "../data/types";
import "./PublishLibrary.scss";
@ -181,7 +181,7 @@ const PublishLibrary = ({
const libContent: ExportedLibraryData = {
type: EXPORT_DATA_TYPES.excalidrawLibrary,
version: 2,
version: VERSIONS.excalidrawLibrary,
source: EXPORT_SOURCE,
libraryItems: clonedLibItems,
};