Skip to content

Commit

Permalink
tested a different sharing option
Browse files Browse the repository at this point in the history
  • Loading branch information
CommanderStorm committed Dec 15, 2023
1 parent d6e48d4 commit 02e4dce
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions webclient/src/components/ShareButton.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,11 @@ const { t } = useI18n({ useScope: "local" });
const { copy, copied, isSupported: clipboardIsSupported } = useClipboard({ source: clipboardSource });
const { share, isSupported: shareIsSupported } = useShare();
function shareOptions(): UseShareOptions {
return {
title: props.name,
text: document.title,
url: `https://nav.tum.de${route.fullPath}`,
};
}
const shareOptions = computed<UseShareOptions>(() => ({
title: props.name,
text: document.title,
url: clipboardSource.value,
}));
</script>

<template>
Expand All @@ -45,7 +43,7 @@ function shareOptions(): UseShareOptions {
{{ t("other_app") }}
</a>
<strong>{{ t("share") }}</strong>
<button v-if="shareIsSupported" type="button" class="btn" @click="share(shareOptions())">
<button v-if="shareIsSupported" type="button" class="btn" @click="share(shareOptions)">
{{ t("share_link") }}
</button>
<button v-if="clipboardIsSupported" type="button" class="btn" @click="copy()">
Expand Down

0 comments on commit 02e4dce

Please sign in to comment.