From 27198a16a428c474d1176316656e494f88454944 Mon Sep 17 00:00:00 2001 From: Laurent Cozic Date: Tue, 5 Apr 2022 15:37:57 +0100 Subject: [PATCH] Chore: Make it easier to test note publishing on desktop --- packages/lib/BaseApplication.ts | 2 +- .../services/joplinServer/personalizedUserContentBaseUrl.ts | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/lib/BaseApplication.ts b/packages/lib/BaseApplication.ts index 6a33f77bd..f26d932f0 100644 --- a/packages/lib/BaseApplication.ts +++ b/packages/lib/BaseApplication.ts @@ -820,7 +820,7 @@ export default class BaseApplication { // Setting.setValue('sync.10.path', 'https://api.joplincloud.com'); // Setting.setValue('sync.10.userContentPath', 'https://joplinusercontent.com'); Setting.setValue('sync.10.path', 'http://api.joplincloud.local:22300'); - Setting.setValue('sync.10.userContentPath', 'http://joplinusercontent.local:22300'); + Setting.setValue('sync.10.userContentPath', 'http://joplincloud.local:22300'); } // For now always disable fuzzy search due to performance issues: diff --git a/packages/lib/services/joplinServer/personalizedUserContentBaseUrl.ts b/packages/lib/services/joplinServer/personalizedUserContentBaseUrl.ts index e776e1a7c..931a1eac1 100644 --- a/packages/lib/services/joplinServer/personalizedUserContentBaseUrl.ts +++ b/packages/lib/services/joplinServer/personalizedUserContentBaseUrl.ts @@ -8,6 +8,9 @@ // // If the userContentBaseUrl is an empty string, the baseUrl is returned instead. export default function(userId: string, baseUrl: string, userContentBaseUrl: string) { + // Special case for development, because it's difficult to get wildcard domains working locally. + if (userContentBaseUrl === 'http://joplincloud.local:22300') return 'http://joplincloud.local:22300'; + if (userContentBaseUrl && baseUrl !== userContentBaseUrl) { if (!userId) throw new Error('User ID must be specified'); const url = new URL(userContentBaseUrl);