mirror of
https://github.com/immich-app/immich.git
synced 2025-12-01 15:59:51 +09:00
fix(web): show download button correctly based on shared link permission (#8288)
* fix(web): show download button correctly based on shared link permission * remove console log * Define initial value * simpler implementation * refactor: show download in asset viewer for shared link * chore: hook timeout --------- Co-authored-by: Jason Rasmussen <jrasm91@gmail.com>
This commit is contained in:
@@ -10,6 +10,7 @@ import {
|
||||
linkOAuthAccount,
|
||||
startOAuth,
|
||||
unlinkOAuthAccount,
|
||||
type SharedLinkResponseDto,
|
||||
type UserResponseDto,
|
||||
} from '@immich/sdk';
|
||||
import { mdiCogRefreshOutline, mdiDatabaseRefreshOutline, mdiImageRefreshOutline } from '@mdi/js';
|
||||
@@ -129,14 +130,12 @@ export const getJobName = (jobName: JobName) => {
|
||||
};
|
||||
|
||||
let _key: string | undefined;
|
||||
let _sharedLink: SharedLinkResponseDto | undefined;
|
||||
|
||||
export const setKey = (key: string) => {
|
||||
_key = key;
|
||||
};
|
||||
|
||||
export const getKey = (): string | undefined => {
|
||||
return _key;
|
||||
};
|
||||
export const setKey = (key: string) => (_key = key);
|
||||
export const getKey = (): string | undefined => _key;
|
||||
export const setSharedLink = (sharedLink: SharedLinkResponseDto) => (_sharedLink = sharedLink);
|
||||
export const getSharedLink = (): SharedLinkResponseDto | undefined => _sharedLink;
|
||||
|
||||
export const isSharedLink = () => {
|
||||
return !!_key;
|
||||
|
||||
Reference in New Issue
Block a user