Files
lucent-laravel/front/js/svelte/files/imageserver.js
T

16 lines
395 B
JavaScript
Raw Normal View History

2023-10-02 23:10:49 +03:00
import {getContext} from "svelte";
2023-10-17 18:56:37 +03:00
export function imgurl(record) {
2023-10-20 21:17:43 +03:00
if(record._file.mime === "image/svg+xml"){
return fileurl(record);
}
2023-10-02 23:10:49 +03:00
const channel = getContext("channel")
return channel.filesUrl + `/thumbs/${record._file.path}`;
}
export function fileurl(record) {
const channel = getContext("channel")
return channel.filesUrl + `/${record._file.path}`;
}