mirror of
https://github.com/immich-app/immich.git
synced 2025-01-21 00:52:43 -05:00
Fixed navigating with keyboard skip assets (#531)
* Cleaned up event listner
This commit is contained in:
parent
bf2760ffef
commit
e344503834
1 changed files with 162 additions and 162 deletions
|
@ -1,5 +1,5 @@
|
|||
<script lang="ts">
|
||||
import { createEventDispatcher, onMount } from 'svelte';
|
||||
import { createEventDispatcher, onMount, onDestroy } from 'svelte';
|
||||
import { fly } from 'svelte/transition';
|
||||
import AsserViewerNavBar from './asser-viewer-nav-bar.svelte';
|
||||
import ChevronRight from 'svelte-material-icons/ChevronRight.svelte';
|
||||
|
@ -9,20 +9,20 @@
|
|||
import { downloadAssets } from '$lib/stores/download';
|
||||
import VideoViewer from './video-viewer.svelte';
|
||||
import { api, AssetResponseDto, AssetTypeEnum } from '@api';
|
||||
import { browser } from '$app/env';
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
export let asset: AssetResponseDto;
|
||||
|
||||
const dispatch = createEventDispatcher();
|
||||
let halfLeftHover = false;
|
||||
let halfRightHover = false;
|
||||
let isShowDetail = false;
|
||||
|
||||
onMount(() => {
|
||||
if (browser) {
|
||||
document.addEventListener('keydown', (keyInfo) => handleKeyboardPress(keyInfo.key));
|
||||
}
|
||||
});
|
||||
|
||||
onDestroy(() => {
|
||||
document.removeEventListener('keydown', (e) => {});
|
||||
});
|
||||
|
||||
const handleKeyboardPress = (key: string) => {
|
||||
|
|
Loading…
Add table
Reference in a new issue