Open source Loom alternative. Beautiful, shareable screen recordings.
Rust appcapcossloommacnextjsnextjs15open-sourceossreactrecordrustscreen-capturescreen-recorderscreenshotsolidjstauritauri-apptypescriptvite
feat(web): add hide logo and org selection actions for share branding
Richie McIlroy147f83b737d7
diff --git a/apps/web/actions/organization/shareable-link-icon.ts b/apps/web/actions/organization/shareable-link-icon.tsindex 02f8dc067..4d750caff 100644--- a/apps/web/actions/organization/shareable-link-icon.ts+++ b/apps/web/actions/organization/shareable-link-icon.ts@@ -2,7 +2,7 @@import { db } from "@cap/database";import { getCurrentUser } from "@cap/database/auth/session";-import { organizations } from "@cap/database/schema";+import { organizations, users } from "@cap/database/schema";import { userIsPro } from "@cap/utils";import { ImageUploads } from "@cap/web-backend";import { Organisation } from "@cap/web-domain";@@ -160,3 +160,44 @@ export async function updateShareableLinkIconPreference({return { success: true };}++export async function hideShareableLinkCapLogo(+ organizationId: Organisation.OrganisationId,+) {+ const organization = await getManageableProOrganization(organizationId);++ await db()+ .update(organizations)+ .set({+ settings: {+ ...(organization.settings ?? {}),+ hideShareableLinkCapLogo: true,+ },+ })+ .where(eq(organizations.id, organization.id));++ revalidateOrganizationBrandingPaths();++ return { success: true };+}++export async function selectShareableLinkBrandingOrganization(+ organizationId: Organisation.OrganisationId,+) {+ const user = await getCurrentUser();++ if (!user) {+ throw new Error("Unauthorized");+ }++ await requireOrganizationSettingsManager(user.id, organizationId);++ await db()+ .update(users)+ .set({ activeOrganizationId: organizationId })+ .where(eq(users.id, user.id));++ revalidatePath("/dashboard");++ return { success: true };+}