version/0.5 #3

Merged
lamacchinadesiderante merged 6 commits from version/0.5 into master 2023-01-11 18:37:31 +00:00
1 changed files with 4 additions and 3 deletions
Showing only changes of commit 9f01f63326 - Show all commits

View File

@ -49,7 +49,7 @@ const Search: React.FC<SearchProps> = ({ setBooks }) => {
const [showLanguageDropdown, setShowLanguageDropdown] = useState<boolean>(true)
useEffect(() => {
const params = new Proxy(new URLSearchParams(window.location.search), {
const params = new Proxy(new URLSearchParams(decodeURIComponent(window.location.search)), {
//@ts-ignore
get: (searchParams, prop) => searchParams.get(prop),
});
@ -94,9 +94,10 @@ const Search: React.FC<SearchProps> = ({ setBooks }) => {
}
const copyToClipboard = () => {
const searchQuery = `${window.location.host}?title=${title}&author=${author}&language=${language}&publisher=${publisher}&isbn=${isbn}&extension=${extension}`;
const searchBase = `${window.location.host}/?`;
const searchQuery = encodeURIComponent(`title=${title}&author=${author}&language=${language}&publisher=${publisher}&isbn=${isbn}&extension=${extension}`)
navigator.clipboard.writeText(searchQuery).then(() => {
navigator.clipboard.writeText(`${searchBase}${searchQuery}`).then(() => {
//console.log('Async: Copying to clipboard was successful!');
}, (err) => {
//console.error('Async: Could not copy text: ', err);