From ea5f9eb1ad7c888872c1b2552076904e33c3c3b5 Mon Sep 17 00:00:00 2001 From: semantic-release-bot Date: Wed, 4 Sep 2024 17:15:15 +0000 Subject: [PATCH 1/2] chore(release): set `package.json` to 1.0.0-dev.93 [skip ci] # [1.0.0-dev.93](https://github.com/powerhouse-inc/document-model-electron/compare/v1.0.0-dev.92...v1.0.0-dev.93) (2024-09-04) ### Features * remove default drives info from connect + add default drives to reactor config ([1483e82](https://github.com/powerhouse-inc/document-model-electron/commit/1483e82d71baeafb5b660595c8857a7343d87dca)) --- CHANGELOG.md | 7 +++++++ package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 970069d3..d69bcf7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# [1.0.0-dev.93](https://github.com/powerhouse-inc/document-model-electron/compare/v1.0.0-dev.92...v1.0.0-dev.93) (2024-09-04) + + +### Features + +* remove default drives info from connect + add default drives to reactor config ([1483e82](https://github.com/powerhouse-inc/document-model-electron/commit/1483e82d71baeafb5b660595c8857a7343d87dca)) + # [1.0.0-dev.92](https://github.com/powerhouse-inc/document-model-electron/compare/v1.0.0-dev.91...v1.0.0-dev.92) (2024-09-04) diff --git a/package.json b/package.json index 5b140d5f..b6af9111 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@powerhousedao/connect", "productName": "Powerhouse-Connect", - "version": "1.0.0-dev.92", + "version": "1.0.0-dev.93", "description": "Powerhouse Connect", "main": ".vite/build/main.js", "license": "AGPL-3.0-only", From af4523898d70b8eb79b6c34746cf1aaa15f91ee7 Mon Sep 17 00:00:00 2001 From: Guillermo Puente Date: Wed, 4 Sep 2024 13:48:27 -0400 Subject: [PATCH 2/2] feat: preserve all remote drives if no default drives config is passed --- src/utils/reactor.ts | 17 +++++++++++------ src/vite-env.d.ts | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/utils/reactor.ts b/src/utils/reactor.ts index dcccf8fc..5661bd89 100644 --- a/src/utils/reactor.ts +++ b/src/utils/reactor.ts @@ -2,14 +2,16 @@ import { DocumentDriveServerOptions } from 'document-drive/server'; const DEFAULT_DRIVES_URL = import.meta.env.PH_CONNECT_DEFAULT_DRIVES_URL || undefined; -const defaultDrivesUrl = DEFAULT_DRIVES_URL?.split(','); +const defaultDrivesUrl = DEFAULT_DRIVES_URL + ? DEFAULT_DRIVES_URL.split(',') + : []; export const getReactorDefaultDrivesConfig = (): Pick< DocumentDriveServerOptions, 'defaultRemoteDrives' | 'removeOldRemoteDrives' > => { const defaultDrives: DocumentDriveServerOptions['defaultRemoteDrives'] = - defaultDrivesUrl?.map(driveUrl => ({ + defaultDrivesUrl.map(driveUrl => ({ url: driveUrl, options: { sharingType: 'PUBLIC', @@ -40,9 +42,12 @@ export const getReactorDefaultDrivesConfig = (): Pick< return { defaultRemoteDrives: defaultDrives, - removeOldRemoteDrives: { - strategy: 'preserve-by-url', - urls: defaultDrivesUrl || [], - }, + removeOldRemoteDrives: + defaultDrivesUrl.length > 0 + ? { + strategy: 'preserve-by-url', + urls: defaultDrivesUrl, + } + : { strategy: 'preserve-all' }, }; }; diff --git a/src/vite-env.d.ts b/src/vite-env.d.ts index 0de38d88..28423456 100644 --- a/src/vite-env.d.ts +++ b/src/vite-env.d.ts @@ -18,7 +18,6 @@ type ImportMetaEnv = { SENTRY_ORG: string SENTRY_PROJECT: string PH_CONNECT_ROUTER_BASENAME: string - PH_CONNECT_DEFAULT_DRIVES_URL: string PH_CONNECT_ENABLED_EDITORS: string PH_CONNECT_DISABLE_ADD_PUBLIC_DRIVES: string PH_CONNECT_SEARCH_BAR_ENABLED: string @@ -40,6 +39,7 @@ type ImportMetaEnv = { PH_CONNECT_SENTRY_DSN: string PH_CONNECT_SENTRY_PROJECT: string PH_CONNECT_SENTRY_ENV: string + PH_CONNECT_DEFAULT_DRIVES_URL?: string // @user-defined-start /* * You can use this section to explicitly extend the type definition of `import.meta.env`