Use compressorjs-next
This commit is contained in:
parent
3d268f1f9d
commit
c9954db3fe
4 changed files with 4 additions and 5 deletions
|
|
@ -70,7 +70,7 @@
|
||||||
"@welshman/signer": "^0.8.4",
|
"@welshman/signer": "^0.8.4",
|
||||||
"@welshman/store": "^0.8.4",
|
"@welshman/store": "^0.8.4",
|
||||||
"@welshman/util": "^0.8.4",
|
"@welshman/util": "^0.8.4",
|
||||||
"compressorjs": "^1.2.1",
|
"compressorjs-next": "^1.1.2",
|
||||||
"daisyui": "^4.12.24",
|
"daisyui": "^4.12.24",
|
||||||
"date-picker-svelte": "^2.17.0",
|
"date-picker-svelte": "^2.17.0",
|
||||||
"dotenv": "^16.6.1",
|
"dotenv": "^16.6.1",
|
||||||
|
|
|
||||||
BIN
pnpm-lock.yaml
BIN
pnpm-lock.yaml
Binary file not shown.
|
|
@ -7,7 +7,6 @@
|
||||||
import CloseCircle from "@assets/icons/close-circle.svg?dataurl"
|
import CloseCircle from "@assets/icons/close-circle.svg?dataurl"
|
||||||
import Magnifier from "@assets/icons/magnifier.svg?dataurl"
|
import Magnifier from "@assets/icons/magnifier.svg?dataurl"
|
||||||
import {fly} from "@lib/transition"
|
import {fly} from "@lib/transition"
|
||||||
import PageContent from "@lib/components/PageContent.svelte"
|
|
||||||
import Button from "@lib/components/Button.svelte"
|
import Button from "@lib/components/Button.svelte"
|
||||||
import Icon from "@lib/components/Icon.svelte"
|
import Icon from "@lib/components/Icon.svelte"
|
||||||
import {deriveEventsForUrl} from "@app/core/state"
|
import {deriveEventsForUrl} from "@app/core/state"
|
||||||
|
|
@ -92,7 +91,7 @@
|
||||||
|
|
||||||
const onRoomSearchResultClick = (event: TrustedEvent) => {
|
const onRoomSearchResultClick = (event: TrustedEvent) => {
|
||||||
close()
|
close()
|
||||||
void goToEvent(event, {keepFocus: true})
|
goToEvent(event, {keepFocus: true})
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -140,13 +140,13 @@ export const compressFile = async (
|
||||||
file: File | Blob,
|
file: File | Blob,
|
||||||
options: Record<string, any> = {},
|
options: Record<string, any> = {},
|
||||||
): Promise<File> => {
|
): Promise<File> => {
|
||||||
const {default: Compressor} = await import("compressorjs")
|
const {default: Compressor} = await import("compressorjs-next")
|
||||||
|
|
||||||
return new Promise<File>((resolve, _reject) => {
|
return new Promise<File>((resolve, _reject) => {
|
||||||
new Compressor(file, {
|
new Compressor(file, {
|
||||||
maxWidth: 2048,
|
maxWidth: 2048,
|
||||||
maxHeight: 2048,
|
maxHeight: 2048,
|
||||||
convertSize: 10 * 1024 * 1024,
|
convertTypes: ["image/png"],
|
||||||
...options,
|
...options,
|
||||||
success: result => resolve(result as File),
|
success: result => resolve(result as File),
|
||||||
error: e => {
|
error: e => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue