short share urls
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
<v-btn id="share-btn" variant="text" prepend-icon="mdi-share" v-if="co.orders.length>0"
|
||||
:disabled="sharing"
|
||||
@click="shareOrder">{{sharing?'Preparing...':'Share'}}</v-btn>
|
||||
<v-tooltip activator="#share-btn" text="Copied share link!" v-model="showSharedTooltip"
|
||||
<v-tooltip activator="#share-btn" :text="shareError?'Error copying share link :(':'Copied share link!'" v-model="showSharedTooltip"
|
||||
:open-on-hover="false" :open-on-click="false"
|
||||
/>
|
||||
</template>
|
||||
@@ -205,6 +205,7 @@ async function doPlaceOrder() {
|
||||
|
||||
const sharing = ref(false)
|
||||
const showSharedTooltip = ref(false)
|
||||
const shareError = ref(false)
|
||||
const showShareDialog = ref(false)
|
||||
const shareUrl = ref(null)
|
||||
|
||||
@@ -212,6 +213,12 @@ function shareOrder() {
|
||||
sharing.value = true
|
||||
track('share')
|
||||
getShareUrl().then(url => {
|
||||
shareError.value = url === null
|
||||
if (url === null) {
|
||||
sharing.value = false
|
||||
return
|
||||
}
|
||||
console.log('share url', url)
|
||||
shareUrl.value = url
|
||||
sharing.value = false
|
||||
navigator.permissions.query({name: "clipboard-write"}).then((permission) => {
|
||||
|
||||
Reference in New Issue
Block a user