fix: Cannot subscribe in prod (#11931)

This commit is contained in:
Tom Moor
2026-04-01 22:57:12 -04:00
committed by GitHub
parent b3227050c8
commit 9516459d31
3 changed files with 7 additions and 5 deletions
+1 -2
View File
@@ -44,6 +44,7 @@ import { Week } from "@shared/utils/time";
import type UserMembership from "~/models/UserMembership";
import { client } from "~/utils/ApiClient";
import DocumentDelete from "~/scenes/DocumentDelete";
import { ProsemirrorHelper } from "~/models/helpers/ProsemirrorHelper";
import DocumentPermanentDelete from "~/scenes/DocumentPermanentDelete";
import DocumentPublish from "~/scenes/DocumentPublish";
import DeleteDocumentsInTrash from "~/scenes/Trash/components/DeleteDocumentsInTrash";
@@ -737,8 +738,6 @@ export const copyDocumentAsPlainText = createAction({
? stores.documents.get(activeDocumentId)
: undefined;
if (document) {
const { ProsemirrorHelper } =
await import("~/models/helpers/ProsemirrorHelper");
copy(ProsemirrorHelper.toPlainText(document));
toast.success(t("Text copied to clipboard"));
}
+1 -2
View File
@@ -25,6 +25,7 @@ import {
settingsPath,
urlify,
} from "~/utils/routeHelpers";
import { ProsemirrorHelper } from "~/models/helpers/ProsemirrorHelper";
import { ActiveTemplateSection, TemplateSection } from "../sections";
import Template from "~/models/Template";
import { AvatarSize } from "~/components/Avatar";
@@ -200,8 +201,6 @@ export const copyTemplateAsPlainText = createAction({
perform: async ({ getActiveModel, t }) => {
const template = getActiveModel(Template);
if (template) {
const { ProsemirrorHelper } =
await import("~/models/helpers/ProsemirrorHelper");
copy(ProsemirrorHelper.toPlainText(template));
toast.success(t("Text copied to clipboard"));
}
+5 -1
View File
@@ -443,9 +443,13 @@ router.post(
async (ctx: APIContext<T.SharesSubscribeReq>) => {
const { shareId, email } = ctx.input.body;
const { transaction } = ctx.state;
const team = await getTeamFromContext(ctx, { includeStateCookie: false });
// Validate the share exists and is published
const { share, document } = await loadPublicShare({ id: shareId });
const { share, document } = await loadPublicShare({
id: shareId,
teamId: team?.id,
});
if (!share.allowSubscriptions) {
throw InvalidRequestError("Subscriptions are not enabled for this share");