Skip to content

Self-hosted personal gallery application with online photo management and albums, supporting Live/Motion Photos, EXIF parsing, geolocation recognition, and an explore map.

fix(cloud): preserve workspace context when redeeming from pricing

Timothy Yinec762c9d3062
diff --git a/apps/cloud/app/components/CloudPricing.vue b/apps/cloud/app/components/CloudPricing.vue
index bbb0717a..3ef9d18c 100644
--- a/apps/cloud/app/components/CloudPricing.vue
+++ b/apps/cloud/app/components/CloudPricing.vue
@@ -22,7 +22,10 @@ const amount = (plan: any) =>
const action = (plan: any) =>
!props.portal && plan.id === data.value?.newPlanId
? links.signup
- : links.redeem
+ : links.redeem +
+ (props.portal && billing?.selected.value
+ ? '?workspaceId=' + billing.selected.value
+ : '')
</script>
<template>
<div class="cf-pricing">
@@ -129,6 +132,14 @@ const action = (plan: any) =>
}}
</p>
<CloudButton
+ v-if="portal && billing?.data.value?.workspace.role !== 'admin'"
+ disabled
+ :title="$t('cloud.billing.adminOnly')"
+ :variant="plan.featured ? 'default' : 'secondary'"
+ >{{ $t('cloud.billing.redeem') }}</CloudButton
+ >
+ <CloudButton
+ v-else
as-child
:variant="plan.featured ? 'default' : 'secondary'"
><NuxtLink