mirror of
https://github.com/excalidraw/excalidraw.git
synced 2025-05-03 10:00:07 -04:00
feat: support libraryReturnUrl
when installing libraries (#3227)
Co-authored-by: Aakansha Doshi <aakansha1216@gmail.com>
This commit is contained in:
parent
47c26cd4cf
commit
91c8b6ecbf
6 changed files with 35 additions and 3 deletions
|
@ -458,6 +458,7 @@ class App extends React.Component<ExcalidrawProps, AppState> {
|
|||
showExitZenModeBtn={
|
||||
typeof this.props?.zenModeEnabled === "undefined" && zenModeEnabled
|
||||
}
|
||||
libraryReturnUrl={this.props.libraryReturnUrl}
|
||||
/>
|
||||
<div className="excalidraw-textEditorContainer" />
|
||||
{this.state.showStats && (
|
||||
|
@ -588,7 +589,7 @@ class App extends React.Component<ExcalidrawProps, AppState> {
|
|||
private importLibraryFromUrl = async (url: string) => {
|
||||
window.history.replaceState({}, APP_NAME, window.location.origin);
|
||||
try {
|
||||
const request = await fetch(url);
|
||||
const request = await fetch(decodeURIComponent(url));
|
||||
const blob = await request.blob();
|
||||
const json = JSON.parse(await blob.text());
|
||||
if (!isValidLibrary(json)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue