mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: don't unnecessarily prompt when installing libraries (#3329)
This commit is contained in:
parent
cf9e29834d
commit
30ae4b8bf2
6 changed files with 10 additions and 7 deletions
|
@ -609,7 +609,7 @@ class App extends React.Component<ExcalidrawProps, AppState> {
|
|||
this.onSceneUpdated();
|
||||
};
|
||||
|
||||
private importLibraryFromUrl = async (url: string) => {
|
||||
private importLibraryFromUrl = async (url: string, token?: string | null) => {
|
||||
if (window.location.hash.includes(URL_HASH_KEYS.addLibrary)) {
|
||||
const hash = new URLSearchParams(window.location.hash.slice(1));
|
||||
hash.delete(URL_HASH_KEYS.addLibrary);
|
||||
|
@ -628,6 +628,7 @@ class App extends React.Component<ExcalidrawProps, AppState> {
|
|||
throw new Error();
|
||||
}
|
||||
if (
|
||||
token === Library.csrfToken ||
|
||||
window.confirm(
|
||||
t("alerts.confirmAddLibrary", { numShapes: json.library.length }),
|
||||
)
|
||||
|
|
|
@ -179,7 +179,7 @@ const LibraryMenuItems = ({
|
|||
<a
|
||||
href={`https://libraries.excalidraw.com?target=${
|
||||
window.name || "_blank"
|
||||
}&referrer=${referrer}&useHash=true`}
|
||||
}&referrer=${referrer}&useHash=true&token=${Library.csrfToken}`}
|
||||
target="_excalidraw_libraries"
|
||||
>
|
||||
{t("labels.libraries")}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue