mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
Use cookies for client requests (#377)
* Use cookie for frontend request * Remove api helper to use SDK * Added error handling to status box * Remove additional places that check for session.user * Refactor sending password * prettier clean up * remove deadcode * Move all authentication requests to the client * refactor upload panel to only fetch assets after the upload panel disappear * Added keydown to remove focus on title change on album viewer
This commit is contained in:
parent
2ebb755f00
commit
83cbf51704
54 changed files with 4954 additions and 4540 deletions
|
|
@ -1,5 +1,4 @@
|
|||
<script lang="ts">
|
||||
import { session } from '$app/stores';
|
||||
import { fade } from 'svelte/transition';
|
||||
|
||||
import { createEventDispatcher, onMount } from 'svelte';
|
||||
|
|
@ -14,33 +13,29 @@
|
|||
const dispatch = createEventDispatcher();
|
||||
|
||||
onMount(async () => {
|
||||
if ($session.user) {
|
||||
const { data } = await api.assetApi.getAssetById(assetId);
|
||||
assetInfo = data;
|
||||
}
|
||||
const { data } = await api.assetApi.getAssetById(assetId);
|
||||
assetInfo = data;
|
||||
});
|
||||
|
||||
const loadAssetData = async () => {
|
||||
if ($session.user) {
|
||||
try {
|
||||
const { data } = await api.assetApi.serveFile(
|
||||
assetInfo.deviceAssetId,
|
||||
deviceId,
|
||||
false,
|
||||
true,
|
||||
{
|
||||
responseType: 'blob'
|
||||
}
|
||||
);
|
||||
|
||||
if (!(data instanceof Blob)) {
|
||||
return;
|
||||
try {
|
||||
const { data } = await api.assetApi.serveFile(
|
||||
assetInfo.deviceAssetId,
|
||||
deviceId,
|
||||
false,
|
||||
true,
|
||||
{
|
||||
responseType: 'blob'
|
||||
}
|
||||
);
|
||||
|
||||
const assetData = URL.createObjectURL(data);
|
||||
return assetData;
|
||||
} catch (e) {}
|
||||
}
|
||||
if (!(data instanceof Blob)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const assetData = URL.createObjectURL(data);
|
||||
return assetData;
|
||||
} catch (e) {}
|
||||
};
|
||||
</script>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue