mirror of
https://codeberg.org/Hyperpipe/Hyperpipe
synced 2025-06-29 05:28:00 +02:00
Closes #110, Added support for Portuguese
This commit is contained in:
parent
1b5d6d4ae1
commit
0a81fcf341
7 changed files with 55 additions and 33 deletions
|
@ -3,7 +3,7 @@ import { ref, onMounted } from 'vue';
|
|||
|
||||
import { getJsonAuth } from '@/scripts/fetch.js';
|
||||
import { useRand } from '@/scripts/colors.js';
|
||||
import { useStore } from '@/scripts/util.js';
|
||||
import { useStore, useShare } from '@/scripts/util.js';
|
||||
import { useUpdatePlaylist } from '@/scripts/db.js';
|
||||
|
||||
import { useResults, useArtist } from '@/stores/results.js';
|
||||
|
@ -87,29 +87,13 @@ const openSong = el => {
|
|||
emit('remove', props.index),
|
||||
);
|
||||
},
|
||||
Share = async () => {
|
||||
if ('share' in navigator) {
|
||||
const data = {
|
||||
title: `Listen to ${props.title} by ${props.author} on Hyperpipe`,
|
||||
url: location.origin + props.play,
|
||||
};
|
||||
Share = () => {
|
||||
const data = {
|
||||
title: `Listen to ${props.title} by ${props.author} on Hyperpipe`,
|
||||
url: location.origin + props.play,
|
||||
};
|
||||
|
||||
try {
|
||||
await navigator.share(data);
|
||||
console.log('Done Sharing!');
|
||||
} catch (err) {
|
||||
console.log(err);
|
||||
}
|
||||
} else {
|
||||
navigator.clipboard.writeText(location.host + props.play).then(
|
||||
() => {
|
||||
alert(t('info.copied_to_clipboard'));
|
||||
},
|
||||
err => {
|
||||
console.log(err);
|
||||
},
|
||||
);
|
||||
}
|
||||
useShare(data);
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue