forked from coracle/flotilla
Use compressorjs-next
This commit is contained in:
@@ -7,7 +7,6 @@
|
||||
import CloseCircle from "@assets/icons/close-circle.svg?dataurl"
|
||||
import Magnifier from "@assets/icons/magnifier.svg?dataurl"
|
||||
import {fly} from "@lib/transition"
|
||||
import PageContent from "@lib/components/PageContent.svelte"
|
||||
import Button from "@lib/components/Button.svelte"
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
import {deriveEventsForUrl} from "@app/core/state"
|
||||
@@ -92,7 +91,7 @@
|
||||
|
||||
const onRoomSearchResultClick = (event: TrustedEvent) => {
|
||||
close()
|
||||
void goToEvent(event, {keepFocus: true})
|
||||
goToEvent(event, {keepFocus: true})
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
+2
-2
@@ -140,13 +140,13 @@ export const compressFile = async (
|
||||
file: File | Blob,
|
||||
options: Record<string, any> = {},
|
||||
): Promise<File> => {
|
||||
const {default: Compressor} = await import("compressorjs")
|
||||
const {default: Compressor} = await import("compressorjs-next")
|
||||
|
||||
return new Promise<File>((resolve, _reject) => {
|
||||
new Compressor(file, {
|
||||
maxWidth: 2048,
|
||||
maxHeight: 2048,
|
||||
convertSize: 10 * 1024 * 1024,
|
||||
convertTypes: ["image/png"],
|
||||
...options,
|
||||
success: result => resolve(result as File),
|
||||
error: e => {
|
||||
|
||||
Reference in New Issue
Block a user