mirror of
https://github.com/blitzkit/blitzkit.git
synced 2026-10-23 19:49:50 +02:00
fix: urlon parsing
This commit is contained in:
1 parent
2608d69ffe
commit
205d9c0ddf
2 files changed
+5
-2
No files matched your search
@@ -3,4 +3,6 @@
|
|||||||
## Features
|
## Features
|
||||||
|
|
||||||
- Added embeds
|
- Added embeds
|
||||||
- This tool is intended
|
- This tool is intended for streamers and content creators but feel free to generate embeds for personal use!
|
||||||
|
- There are tons of options and an infinite amount of possible customizations
|
||||||
|
- BlitzKit only offers 1 embed at the moment but feel free to suggest more
|
||||||
@@ -8,6 +8,7 @@ import {
|
|||||||
Tooltip,
|
Tooltip,
|
||||||
} from '@radix-ui/themes';
|
} from '@radix-ui/themes';
|
||||||
import { useRef, useState } from 'react';
|
import { useRef, useState } from 'react';
|
||||||
|
import { parse } from 'urlon';
|
||||||
import { EmbedState } from '../../stores/embedState';
|
import { EmbedState } from '../../stores/embedState';
|
||||||
|
|
||||||
export function Import() {
|
export function Import() {
|
||||||
@@ -57,7 +58,7 @@ export function Import() {
|
|||||||
const url = new URL(importInput.current.value);
|
const url = new URL(importInput.current.value);
|
||||||
const state = url.searchParams.get('state');
|
const state = url.searchParams.get('state');
|
||||||
if (state === null) throw undefined;
|
if (state === null) throw undefined;
|
||||||
const json = JSON.parse(state);
|
const json = parse(state);
|
||||||
|
|
||||||
mutateEmbedState((draft) => {
|
mutateEmbedState((draft) => {
|
||||||
Object.assign(draft, json);
|
Object.assign(draft, json);
|
||||||
|
|||||||
Reference in new issue
Block a user