mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +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:
@@ -2,12 +2,10 @@ import { writable, derived } from 'svelte/store';
|
||||
|
||||
export const downloadAssets = writable<Record<string, number>>({});
|
||||
|
||||
|
||||
export const isDownloading = derived(downloadAssets, ($downloadAssets) => {
|
||||
if (Object.keys($downloadAssets).length == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
})
|
||||
if (Object.keys($downloadAssets).length == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
});
|
||||
|
||||
@@ -20,7 +20,7 @@ function createUploadStore() {
|
||||
if (asset.id == id) {
|
||||
return {
|
||||
...asset,
|
||||
progress: progress,
|
||||
progress: progress
|
||||
};
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ function createUploadStore() {
|
||||
isUploading,
|
||||
addNewUploadAsset,
|
||||
updateProgress,
|
||||
removeUploadAsset,
|
||||
removeUploadAsset
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -4,19 +4,16 @@ import { serverEndpoint } from '../constants';
|
||||
|
||||
let websocket: Socket;
|
||||
|
||||
export const openWebsocketConnection = (accessToken: string) => {
|
||||
export const openWebsocketConnection = () => {
|
||||
const websocketEndpoint = serverEndpoint.replace('/api', '');
|
||||
|
||||
try {
|
||||
websocket = io(websocketEndpoint, {
|
||||
websocket = io('', {
|
||||
path: '/api/socket.io',
|
||||
transports: ['polling'],
|
||||
reconnection: true,
|
||||
forceNew: true,
|
||||
autoConnect: true,
|
||||
extraHeaders: {
|
||||
Authorization: 'Bearer ' + accessToken,
|
||||
},
|
||||
autoConnect: true
|
||||
});
|
||||
|
||||
listenToEvent(websocket);
|
||||
|
||||
Reference in New Issue
Block a user