mirror of
https://codeberg.org/Hyperpipe/Hyperpipe
synced 2025-06-28 13:08:01 +02:00
Closes #110, Added support for Portuguese
This commit is contained in:
parent
7c5be09194
commit
c6c20eac1f
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';
|
||||
|
@ -85,29 +85,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('Copied to Clipboard');
|
||||
},
|
||||
err => {
|
||||
console.log(err);
|
||||
},
|
||||
);
|
||||
}
|
||||
useShare(data);
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue