Skip to content

Commit 0a2c780

Browse files
committed
Merge branch 'dev' into main
2 parents 7f0d7cf + 737eead commit 0a2c780

File tree

10 files changed

+37
-37
lines changed

10 files changed

+37
-37
lines changed

apps/app-server/src/trpc/api/users/account/stripe/create-checkout-session.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,7 @@ export async function createCheckoutSession({
109109

110110
customer: customer.id,
111111

112-
success_url: `${ctx.req.headers['origin']}/subscribed#/subscribed`,
113-
cancel_url: `${ctx.req.headers['origin']}/pricing#/pricing`,
112+
success_url: `${ctx.req.headers['origin']}/subscribed`,
114113
});
115114

116115
if (session.url == null) {

apps/app-server/src/trpc/api/users/account/stripe/create-portal-session.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,21 +2,15 @@ import { checkRedlockSignalAborted } from '@stdlib/redlock';
22
import { once } from 'lodash';
33
import type { InferProcedureOpts } from 'src/trpc/helpers';
44
import { authProcedure } from 'src/trpc/helpers';
5-
import { z } from 'zod';
65

7-
const baseProcedure = authProcedure.input(
8-
z.object({
9-
returnUrl: z.string().url(),
10-
}),
11-
);
6+
const baseProcedure = authProcedure;
127

138
export const createPortalSessionProcedure = once(() =>
149
baseProcedure.mutation(createPortalSession),
1510
);
1611

1712
export async function createPortalSession({
1813
ctx,
19-
input,
2014
}: InferProcedureOpts<typeof baseProcedure>) {
2115
return await ctx.usingLocks(
2216
[[`user-lock:${ctx.userId}`]],
@@ -39,7 +33,6 @@ export async function createPortalSession({
3933

4034
const portalSession = await ctx.stripe.billingPortal.sessions.create({
4135
customer: customerId,
42-
return_url: input.returnUrl,
4336
});
4437

4538
// Return portal session URL

apps/client/src-electron/electron-main.ts

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ function createWindow() {
6868
contextIsolation: true,
6969
// More info: https://v2.quasar.dev/quasar-cli-vite/developing-electron-apps/electron-preload-script
7070
preload: path.resolve(__dirname, process.env.QUASAR_ELECTRON_PRELOAD),
71+
devTools: !!process.env.DEBUGGING,
7172
},
7273
show: false,
7374
});
@@ -79,13 +80,20 @@ function createWindow() {
7980

8081
if (!process.env.DEBUGGING) {
8182
mainWindow.setMenuBarVisibility(false);
82-
83-
// we're on production; no access to devtools pls
84-
mainWindow.webContents.on('devtools-opened', () => {
85-
mainWindow?.webContents.closeDevTools();
86-
});
8783
}
8884

85+
mainWindow.webContents.setWindowOpenHandler((details) => {
86+
return {
87+
action: 'allow',
88+
overrideBrowserWindowOptions: {
89+
autoHideMenuBar: true,
90+
webPreferences: {
91+
devTools: false,
92+
},
93+
},
94+
};
95+
});
96+
8997
mainWindow.on('closed', () => {
9098
mainWindow = undefined;
9199
});
@@ -105,7 +113,7 @@ function createWindow() {
105113
obj[key] = value;
106114
}
107115

108-
function getValue(obj: any, key: string) {
116+
function getValue(obj: any, key: string): string | undefined {
109117
const lowerCaseKey = key.toLowerCase();
110118

111119
for (const key of Object.keys(obj)) {
@@ -160,21 +168,23 @@ function createWindow() {
160168
const cookieName = Object.keys(parsedCookie)[0];
161169

162170
const expires = getValue(parsedCookie, 'Expires');
163-
const sameSite = getValue(parsedCookie, 'SameSite');
171+
const sameSite = getValue(parsedCookie, 'SameSite')?.toLowerCase();
164172

165-
const cookieDetails = {
173+
const cookieDetails: Electron.CookiesSetDetails = {
166174
url: 'https://deepnotes.app',
167175
name: cookieName,
168176
value: parsedCookie[cookieName],
169-
// domain: getValue(parsedCookie, 'Domain'),
170-
// path: getValue(parsedCookie, 'Path'),
171-
// secure: getValue(parsedCookie, 'Secure'),
172-
// httpOnly: getValue(parsedCookie, 'HttpOnly'),
177+
domain: getValue(parsedCookie, 'Domain'),
178+
path: getValue(parsedCookie, 'Path'),
179+
secure: getValue(parsedCookie, 'Secure') != null,
180+
httpOnly: getValue(parsedCookie, 'HttpOnly') != null,
173181
expirationDate: expires ? new Date(expires).getTime() : undefined,
174-
// sameSite:
175-
// sameSite?.toLowerCase() !== 'none'
176-
// ? sameSite?.toLowerCase()
177-
// : 'no_restriction',
182+
sameSite:
183+
sameSite == null
184+
? 'lax'
185+
: sameSite === 'none'
186+
? 'no_restriction'
187+
: (sameSite as any),
178188
};
179189

180190
void mainWindow?.webContents.session.cookies

apps/client/src/pages/home/Download/Download.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ import { multiModePath } from 'src/code/utils/misc';
209209
210210
import PlatformCard from './PlatformCard.vue';
211211
212-
const version = '1.0.0';
212+
const version = '1.0.1';
213213
214214
const loading = ref(true);
215215

apps/client/src/pages/home/Pricing/Pricing.vue

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,15 +148,13 @@ async function createCheckoutSession() {
148148
const { checkoutSessionUrl } =
149149
await trpcClient.users.account.stripe.createCheckoutSession.mutate();
150150
151-
location.href = checkoutSessionUrl;
151+
window.open(checkoutSessionUrl, '_blank');
152152
}
153153
154154
async function createPortalSession() {
155155
const { portalSessionUrl } =
156-
await trpcClient.users.account.stripe.createPortalSession.mutate({
157-
returnUrl: location.href,
158-
});
156+
await trpcClient.users.account.stripe.createPortalSession.mutate();
159157
160-
location.href = portalSessionUrl;
158+
window.open(portalSessionUrl, '_blank');
161159
}
162160
</script>

captain-definition-app-server

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"schemaVersion": 2,
33
"caproverName": "captain-01",
44
"caproverApp": "deepnotes-app-server",
5-
"branch": "main",
5+
"branch": "dev",
66
"dockerfilePath": "./apps/app-server/Dockerfile"
77
}

captain-definition-client

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"schemaVersion": 2,
33
"caproverName": "captain-01",
44
"caproverApp": "deepnotes-client",
5-
"branch": "main",
5+
"branch": "dev",
66
"dockerfilePath": "./apps/client/Dockerfile"
77
}

captain-definition-collab-server

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"schemaVersion": 2,
33
"caproverName": "captain-01",
44
"caproverApp": "deepnotes-collab-server",
5-
"branch": "main",
5+
"branch": "dev",
66
"dockerfilePath": "./apps/collab-server/Dockerfile"
77
}

captain-definition-realtime-server

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"schemaVersion": 2,
33
"caproverName": "captain-01",
44
"caproverApp": "deepnotes-realtime-server",
5-
"branch": "main",
5+
"branch": "dev",
66
"dockerfilePath": "./apps/realtime-server/Dockerfile"
77
}

captain-definition-scheduler

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
"schemaVersion": 2,
33
"caproverName": "captain-01",
44
"caproverApp": "deepnotes-scheduler",
5-
"branch": "main",
5+
"branch": "dev",
66
"dockerfilePath": "./apps/scheduler/Dockerfile"
77
}

0 commit comments

Comments
 (0)