From 804fbbe78e2bde314792f21cb966668037ef37cc Mon Sep 17 00:00:00 2001 From: Varun Patil Date: Sun, 14 May 2023 17:26:14 -0700 Subject: [PATCH] nx: play touch sound on sel manager viewer open Signed-off-by: Varun Patil --- src/components/SelectionManager.vue | 2 ++ src/native.ts | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/src/components/SelectionManager.vue b/src/components/SelectionManager.vue index d2525eac..29941908 100644 --- a/src/components/SelectionManager.vue +++ b/src/components/SelectionManager.vue @@ -54,6 +54,7 @@ import { getCurrentUser } from '@nextcloud/auth'; import * as dav from '../services/DavRequests'; import * as utils from '../services/Utils'; +import * as nativex from '../native'; import FaceMoveModal from './modal/FaceMoveModal.vue'; import AddToAlbumModal from './modal/AddToAlbumModal.vue'; @@ -848,6 +849,7 @@ export default defineComponent({ /** Open viewer with given photo */ openViewer(photo: IPhoto) { + nativex.playTouchSound(); this.$router.push(utils.getViewerRoute(photo)); }, }, diff --git a/src/native.ts b/src/native.ts index ff21d066..6e07cebf 100644 --- a/src/native.ts +++ b/src/native.ts @@ -27,6 +27,7 @@ export type NativeX = { isNative: () => boolean; setThemeColor: (color: string, isDark: boolean) => void; downloadFromUrl: (url: string, filename: string) => void; + playTouchSound: () => void; playVideoLocal: (fileid: string) => void; playVideoHls: (fileid: string, url: string) => void; @@ -73,6 +74,13 @@ export async function downloadFromUrl(url: string) { nativex?.downloadFromUrl?.(addOrigin(url), filename); } +/** + * Play touch sound. + */ +export async function playTouchSound() { + nativex?.playTouchSound?.(); +} + /** * Play a video from the given file ID (local file). */