nx: play touch sound on sel manager viewer open

Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/653/head
Varun Patil 2023-05-14 17:26:14 -07:00
parent 82251aa6ec
commit 804fbbe78e
2 changed files with 10 additions and 0 deletions

View File

@ -54,6 +54,7 @@ import { getCurrentUser } from '@nextcloud/auth';
import * as dav from '../services/DavRequests'; import * as dav from '../services/DavRequests';
import * as utils from '../services/Utils'; import * as utils from '../services/Utils';
import * as nativex from '../native';
import FaceMoveModal from './modal/FaceMoveModal.vue'; import FaceMoveModal from './modal/FaceMoveModal.vue';
import AddToAlbumModal from './modal/AddToAlbumModal.vue'; import AddToAlbumModal from './modal/AddToAlbumModal.vue';
@ -848,6 +849,7 @@ export default defineComponent({
/** Open viewer with given photo */ /** Open viewer with given photo */
openViewer(photo: IPhoto) { openViewer(photo: IPhoto) {
nativex.playTouchSound();
this.$router.push(utils.getViewerRoute(photo)); this.$router.push(utils.getViewerRoute(photo));
}, },
}, },

View File

@ -27,6 +27,7 @@ export type NativeX = {
isNative: () => boolean; isNative: () => boolean;
setThemeColor: (color: string, isDark: boolean) => void; setThemeColor: (color: string, isDark: boolean) => void;
downloadFromUrl: (url: string, filename: string) => void; downloadFromUrl: (url: string, filename: string) => void;
playTouchSound: () => void;
playVideoLocal: (fileid: string) => void; playVideoLocal: (fileid: string) => void;
playVideoHls: (fileid: string, url: string) => void; playVideoHls: (fileid: string, url: string) => void;
@ -73,6 +74,13 @@ export async function downloadFromUrl(url: string) {
nativex?.downloadFromUrl?.(addOrigin(url), filename); nativex?.downloadFromUrl?.(addOrigin(url), filename);
} }
/**
* Play touch sound.
*/
export async function playTouchSound() {
nativex?.playTouchSound?.();
}
/** /**
* Play a video from the given file ID (local file). * Play a video from the given file ID (local file).
*/ */