fix: disable sqlite provider (#2888)
Co-authored-by: Alex Yang <himself65@outlook.com>
This commit is contained in:
1
.github/workflows/build.yml
vendored
1
.github/workflows/build.yml
vendored
@@ -92,6 +92,7 @@ jobs:
|
|||||||
ENABLE_LEGACY_PROVIDER: true
|
ENABLE_LEGACY_PROVIDER: true
|
||||||
ENABLE_PRELOADING: false
|
ENABLE_PRELOADING: false
|
||||||
ENABLE_NEW_SETTING_MODAL: false
|
ENABLE_NEW_SETTING_MODAL: false
|
||||||
|
ENABLE_SQLITE_PROVIDER: false
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|||||||
1
.github/workflows/nightly-build.yml
vendored
1
.github/workflows/nightly-build.yml
vendored
@@ -61,6 +61,7 @@ jobs:
|
|||||||
API_SERVER_PROFILE: prod
|
API_SERVER_PROFILE: prod
|
||||||
ENABLE_TEST_PROPERTIES: false
|
ENABLE_TEST_PROPERTIES: false
|
||||||
ENABLE_BOOKMARK_OPERATION: true
|
ENABLE_BOOKMARK_OPERATION: true
|
||||||
|
ENABLE_SQLITE_PROVIDER: false
|
||||||
RELEASE_VERSION: ${{ needs.set-build-version.outputs.version }}
|
RELEASE_VERSION: ${{ needs.set-build-version.outputs.version }}
|
||||||
|
|
||||||
- name: Upload Artifact (web-static)
|
- name: Upload Artifact (web-static)
|
||||||
|
|||||||
1
.github/workflows/release-desktop-app.yml
vendored
1
.github/workflows/release-desktop-app.yml
vendored
@@ -57,6 +57,7 @@ jobs:
|
|||||||
API_SERVER_PROFILE: prod
|
API_SERVER_PROFILE: prod
|
||||||
ENABLE_TEST_PROPERTIES: false
|
ENABLE_TEST_PROPERTIES: false
|
||||||
ENABLE_BOOKMARK_OPERATION: true
|
ENABLE_BOOKMARK_OPERATION: true
|
||||||
|
ENABLE_SQLITE_PROVIDER: false
|
||||||
RELEASE_VERSION: ${{ github.event.inputs.version }}
|
RELEASE_VERSION: ${{ github.event.inputs.version }}
|
||||||
|
|
||||||
- name: Upload Artifact (web-static)
|
- name: Upload Artifact (web-static)
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import fs from 'fs-extra';
|
|||||||
|
|
||||||
import { test } from './fixture';
|
import { test } from './fixture';
|
||||||
|
|
||||||
test('check workspace has a DB file', async ({ appInfo, workspace }) => {
|
test.skip('check workspace has a DB file', async ({ appInfo, workspace }) => {
|
||||||
const w = await workspace.current();
|
const w = await workspace.current();
|
||||||
const dbPath = path.join(
|
const dbPath = path.join(
|
||||||
appInfo.sessionData,
|
appInfo.sessionData,
|
||||||
@@ -17,7 +17,7 @@ test('check workspace has a DB file', async ({ appInfo, workspace }) => {
|
|||||||
expect(await fs.exists(dbPath)).toBe(true);
|
expect(await fs.exists(dbPath)).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('move workspace db file', async ({ page, appInfo, workspace }) => {
|
test.skip('move workspace db file', async ({ page, appInfo, workspace }) => {
|
||||||
const w = await workspace.current();
|
const w = await workspace.current();
|
||||||
const settingButton = page.getByTestId('slider-bar-workspace-setting-button');
|
const settingButton = page.getByTestId('slider-bar-workspace-setting-button');
|
||||||
// goto settings
|
// goto settings
|
||||||
@@ -42,7 +42,7 @@ test('move workspace db file', async ({ page, appInfo, workspace }) => {
|
|||||||
expect(files.some(f => f.endsWith('.affine'))).toBe(true);
|
expect(files.some(f => f.endsWith('.affine'))).toBe(true);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('export then add', async ({ page, appInfo, workspace }) => {
|
test.skip('export then add', async ({ page, appInfo, workspace }) => {
|
||||||
const w = await workspace.current();
|
const w = await workspace.current();
|
||||||
const settingButton = page.getByTestId('slider-bar-workspace-setting-button');
|
const settingButton = page.getByTestId('slider-bar-workspace-setting-button');
|
||||||
// goto settings
|
// goto settings
|
||||||
|
|||||||
@@ -30,21 +30,12 @@ export const buildFlags = {
|
|||||||
enableLegacyCloud: process.env.ENABLE_LEGACY_PROVIDER
|
enableLegacyCloud: process.env.ENABLE_LEGACY_PROVIDER
|
||||||
? process.env.ENABLE_LEGACY_PROVIDER === 'true'
|
? process.env.ENABLE_LEGACY_PROVIDER === 'true'
|
||||||
: true,
|
: true,
|
||||||
enableBroadcastChannelProvider: Boolean(
|
enableBroadcastChannelProvider: process.env.ENABLE_BC_PROVIDER !== 'false',
|
||||||
process.env.ENABLE_BC_PROVIDER ?? '1'
|
enableDebugPage: true,
|
||||||
),
|
|
||||||
enableDebugPage: Boolean(
|
|
||||||
process.env.ENABLE_DEBUG_PAGE ?? process.env.NODE_ENV === 'development'
|
|
||||||
),
|
|
||||||
changelogUrl:
|
changelogUrl:
|
||||||
process.env.CHANGELOG_URL ??
|
process.env.CHANGELOG_URL ??
|
||||||
'https://affine.pro/blog/what-is-new-affine-0620',
|
'https://affine.pro/blog/what-is-new-affine-0620',
|
||||||
enablePreloading:
|
enablePreloading: process.env.ENABLE_PRELOADING === 'true',
|
||||||
process.env.ENABLE_PRELOADING === undefined
|
enableNewSettingModal: process.env.ENABLE_NEW_SETTING_MODAL === 'true',
|
||||||
? true
|
enableSQLiteProvider: process.env.ENABLE_SQLITE_PROVIDER === 'true',
|
||||||
: process.env.ENABLE_PRELOADING === 'true',
|
|
||||||
enableNewSettingModal:
|
|
||||||
process.env.ENABLE_NEW_SETTING_MODAL === undefined
|
|
||||||
? true
|
|
||||||
: process.env.ENABLE_PRELOADING === 'true',
|
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { DebugLogger } from '@affine/debug';
|
import { DebugLogger } from '@affine/debug';
|
||||||
|
import { config } from '@affine/env';
|
||||||
import { WorkspaceFlavour, WorkspaceVersion } from '@affine/env/workspace';
|
import { WorkspaceFlavour, WorkspaceVersion } from '@affine/env/workspace';
|
||||||
import type { RootWorkspaceMetadataV2 } from '@affine/workspace/atom';
|
import type { RootWorkspaceMetadataV2 } from '@affine/workspace/atom';
|
||||||
import { rootWorkspacesMetadataAtom } from '@affine/workspace/atom';
|
import { rootWorkspacesMetadataAtom } from '@affine/workspace/atom';
|
||||||
@@ -52,7 +53,7 @@ rootWorkspacesMetadataAtom.onMount = setAtom => {
|
|||||||
}, 0);
|
}, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (environment.isDesktop) {
|
if (environment.isDesktop && config.enableSQLiteProvider) {
|
||||||
window.apis?.workspace
|
window.apis?.workspace
|
||||||
.list()
|
.list()
|
||||||
.then(workspaceIDs => {
|
.then(workspaceIDs => {
|
||||||
|
|||||||
@@ -290,7 +290,11 @@ export const CreateWorkspaceModal = ({
|
|||||||
console.error(err);
|
console.error(err);
|
||||||
});
|
});
|
||||||
} else if (mode === 'new') {
|
} else if (mode === 'new') {
|
||||||
setStep(environment.isDesktop ? 'set-db-location' : 'name-workspace');
|
setStep(
|
||||||
|
environment.isDesktop && config.enableSQLiteProvider
|
||||||
|
? 'set-db-location'
|
||||||
|
: 'name-workspace'
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
setStep(undefined);
|
setStep(undefined);
|
||||||
}
|
}
|
||||||
@@ -342,7 +346,7 @@ export const CreateWorkspaceModal = ({
|
|||||||
const onConfirmName = useCallback(
|
const onConfirmName = useCallback(
|
||||||
(name: string) => {
|
(name: string) => {
|
||||||
setWorkspaceName(name);
|
setWorkspaceName(name);
|
||||||
if (environment.isDesktop) {
|
if (environment.isDesktop && config.enableSQLiteProvider) {
|
||||||
setStep('set-syncing-mode');
|
setStep('set-syncing-mode');
|
||||||
} else {
|
} else {
|
||||||
// this will be the last step for web for now
|
// this will be the last step for web for now
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { Button, toast, Wrapper } from '@affine/component';
|
import { Button, toast, Wrapper } from '@affine/component';
|
||||||
|
import { config } from '@affine/env';
|
||||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||||
import { rootCurrentWorkspaceIdAtom } from '@affine/workspace/atom';
|
import { rootCurrentWorkspaceIdAtom } from '@affine/workspace/atom';
|
||||||
import { useAtomValue } from 'jotai';
|
import { useAtomValue } from 'jotai';
|
||||||
@@ -12,7 +13,7 @@ export const ExportPanel = () => {
|
|||||||
<Button
|
<Button
|
||||||
type="light"
|
type="light"
|
||||||
shape="circle"
|
shape="circle"
|
||||||
disabled={!environment.isDesktop || !id}
|
disabled={!environment.isDesktop || !id || !config.enableSQLiteProvider}
|
||||||
data-testid="export-affine-backup"
|
data-testid="export-affine-backup"
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
if (id) {
|
if (id) {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { Button, toast } from '@affine/component';
|
import { Button, toast } from '@affine/component';
|
||||||
import { WorkspaceAvatar } from '@affine/component/workspace-avatar';
|
import { WorkspaceAvatar } from '@affine/component/workspace-avatar';
|
||||||
|
import { config } from '@affine/env';
|
||||||
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
import { useAFFiNEI18N } from '@affine/i18n/hooks';
|
||||||
import {
|
import {
|
||||||
ArrowRightSmallIcon,
|
ArrowRightSmallIcon,
|
||||||
@@ -26,7 +27,12 @@ import { StyledInput } from './style';
|
|||||||
const useShowOpenDBFile = (workspaceId: string) => {
|
const useShowOpenDBFile = (workspaceId: string) => {
|
||||||
const [show, setShow] = useState(false);
|
const [show, setShow] = useState(false);
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (window.apis && window.events && environment.isDesktop) {
|
if (
|
||||||
|
window.apis &&
|
||||||
|
window.events &&
|
||||||
|
environment.isDesktop &&
|
||||||
|
config.enableSQLiteProvider
|
||||||
|
) {
|
||||||
window.apis.workspace
|
window.apis.workspace
|
||||||
.getMeta(workspaceId)
|
.getMeta(workspaceId)
|
||||||
.then(meta => {
|
.then(meta => {
|
||||||
@@ -137,7 +143,9 @@ export const GeneralPanel: React.FC<PanelProps> = ({
|
|||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<DesktopClientOnly workspaceId={workspace.id} />
|
{environment.isDesktop && config.enableSQLiteProvider ? (
|
||||||
|
<DesktopClientOnly workspaceId={workspace.id} />
|
||||||
|
) : null}
|
||||||
<div className={style.row}>
|
<div className={style.row}>
|
||||||
<div className={style.col}>
|
<div className={style.col}>
|
||||||
<div className={style.settingItemLabel}>
|
<div className={style.settingItemLabel}>
|
||||||
@@ -201,7 +209,7 @@ function DesktopClientOnly({ workspaceId }: { workspaceId: string }) {
|
|||||||
const t = useAFFiNEI18N();
|
const t = useAFFiNEI18N();
|
||||||
const showOpenFolder = useShowOpenDBFile(workspaceId);
|
const showOpenFolder = useShowOpenDBFile(workspaceId);
|
||||||
const onRevealDBFile = useCallback(() => {
|
const onRevealDBFile = useCallback(() => {
|
||||||
if (environment.isDesktop) {
|
if (environment.isDesktop && config.enableSQLiteProvider) {
|
||||||
window.apis?.dialog.revealDBFile(workspaceId).catch(err => {
|
window.apis?.dialog.revealDBFile(workspaceId).catch(err => {
|
||||||
console.error(err);
|
console.error(err);
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import {
|
|||||||
} from '@affine/component';
|
} from '@affine/component';
|
||||||
import { ScrollableContainer } from '@affine/component';
|
import { ScrollableContainer } from '@affine/component';
|
||||||
import { WorkspaceList } from '@affine/component/workspace-list';
|
import { WorkspaceList } from '@affine/component/workspace-list';
|
||||||
|
import { config } from '@affine/env/config';
|
||||||
import type {
|
import type {
|
||||||
AffineLegacyCloudWorkspace,
|
AffineLegacyCloudWorkspace,
|
||||||
LocalWorkspace,
|
LocalWorkspace,
|
||||||
@@ -55,6 +56,107 @@ interface WorkspaceModalProps {
|
|||||||
onMoveWorkspace: (activeId: string, overId: string) => void;
|
onMoveWorkspace: (activeId: string, overId: string) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const CreateWorkspaceCard = ({
|
||||||
|
onNewWorkspace,
|
||||||
|
onAddWorkspace,
|
||||||
|
}: {
|
||||||
|
onNewWorkspace: () => void;
|
||||||
|
onAddWorkspace: () => void;
|
||||||
|
}) => {
|
||||||
|
const t = useAFFiNEI18N();
|
||||||
|
const anchorEL = useRef<HTMLDivElement>(null);
|
||||||
|
|
||||||
|
if (config.enableSQLiteProvider && environment.isDesktop) {
|
||||||
|
return (
|
||||||
|
<Menu
|
||||||
|
placement="auto"
|
||||||
|
trigger={['click']}
|
||||||
|
zIndex={1000}
|
||||||
|
content={
|
||||||
|
<StyledCreateWorkspaceCardPillContainer>
|
||||||
|
<StyledCreateWorkspaceCardPill>
|
||||||
|
<MenuItem
|
||||||
|
style={{
|
||||||
|
height: 'auto',
|
||||||
|
padding: '8px 12px',
|
||||||
|
}}
|
||||||
|
onClick={onNewWorkspace}
|
||||||
|
data-testid="new-workspace"
|
||||||
|
>
|
||||||
|
<StyledCreateWorkspaceCardPillContent>
|
||||||
|
<div>
|
||||||
|
<p>{t['New Workspace']()}</p>
|
||||||
|
<StyledCreateWorkspaceCardPillTextSecondary>
|
||||||
|
<p>{t['Create your own workspace']()}</p>
|
||||||
|
</StyledCreateWorkspaceCardPillTextSecondary>
|
||||||
|
</div>
|
||||||
|
<StyledCreateWorkspaceCardPillIcon>
|
||||||
|
<PlusIcon />
|
||||||
|
</StyledCreateWorkspaceCardPillIcon>
|
||||||
|
</StyledCreateWorkspaceCardPillContent>
|
||||||
|
</MenuItem>
|
||||||
|
</StyledCreateWorkspaceCardPill>
|
||||||
|
<StyledCreateWorkspaceCardPill>
|
||||||
|
<MenuItem
|
||||||
|
onClick={onAddWorkspace}
|
||||||
|
data-testid="add-workspace"
|
||||||
|
style={{
|
||||||
|
height: 'auto',
|
||||||
|
padding: '8px 12px',
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<StyledCreateWorkspaceCardPillContent>
|
||||||
|
<div>
|
||||||
|
<p>{t['Add Workspace']()}</p>
|
||||||
|
<StyledCreateWorkspaceCardPillTextSecondary>
|
||||||
|
<p>{t['Add Workspace Hint']()}</p>
|
||||||
|
</StyledCreateWorkspaceCardPillTextSecondary>
|
||||||
|
</div>
|
||||||
|
<StyledCreateWorkspaceCardPillIcon>
|
||||||
|
<ImportIcon />
|
||||||
|
</StyledCreateWorkspaceCardPillIcon>
|
||||||
|
</StyledCreateWorkspaceCardPillContent>
|
||||||
|
</MenuItem>
|
||||||
|
</StyledCreateWorkspaceCardPill>
|
||||||
|
</StyledCreateWorkspaceCardPillContainer>
|
||||||
|
}
|
||||||
|
>
|
||||||
|
<StyledCreateWorkspaceCard
|
||||||
|
ref={anchorEL}
|
||||||
|
data-testid="add-or-new-workspace"
|
||||||
|
>
|
||||||
|
<StyleWorkspaceAdd className="add-icon">
|
||||||
|
<PlusIcon />
|
||||||
|
</StyleWorkspaceAdd>
|
||||||
|
|
||||||
|
<StyleWorkspaceInfo>
|
||||||
|
<StyleWorkspaceTitle>{t['New Workspace']()}</StyleWorkspaceTitle>
|
||||||
|
<p>{t['Create Or Import']()}</p>
|
||||||
|
</StyleWorkspaceInfo>
|
||||||
|
</StyledCreateWorkspaceCard>
|
||||||
|
</Menu>
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<StyledCreateWorkspaceCard
|
||||||
|
onClick={onNewWorkspace}
|
||||||
|
data-testid="new-workspace"
|
||||||
|
>
|
||||||
|
<StyleWorkspaceAdd className="add-icon">
|
||||||
|
<PlusIcon />
|
||||||
|
</StyleWorkspaceAdd>
|
||||||
|
|
||||||
|
<StyleWorkspaceInfo>
|
||||||
|
<StyleWorkspaceTitle>{t['New Workspace']()}</StyleWorkspaceTitle>
|
||||||
|
<p>{t['Create Or Import']()}</p>
|
||||||
|
</StyleWorkspaceInfo>
|
||||||
|
</StyledCreateWorkspaceCard>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
export const WorkspaceListModal = ({
|
export const WorkspaceListModal = ({
|
||||||
disabled,
|
disabled,
|
||||||
open,
|
open,
|
||||||
@@ -71,7 +173,6 @@ export const WorkspaceListModal = ({
|
|||||||
onMoveWorkspace,
|
onMoveWorkspace,
|
||||||
}: WorkspaceModalProps) => {
|
}: WorkspaceModalProps) => {
|
||||||
const t = useAFFiNEI18N();
|
const t = useAFFiNEI18N();
|
||||||
const anchorEL = useRef<HTMLDivElement>(null);
|
|
||||||
return (
|
return (
|
||||||
<Modal open={open} onClose={onClose}>
|
<Modal open={open} onClose={onClose}>
|
||||||
<ModalWrapper
|
<ModalWrapper
|
||||||
@@ -128,98 +229,10 @@ export const WorkspaceListModal = ({
|
|||||||
[onMoveWorkspace]
|
[onMoveWorkspace]
|
||||||
)}
|
)}
|
||||||
/>
|
/>
|
||||||
{!environment.isDesktop && (
|
<CreateWorkspaceCard
|
||||||
<div>
|
onNewWorkspace={onNewWorkspace}
|
||||||
<StyledCreateWorkspaceCard
|
onAddWorkspace={onAddWorkspace}
|
||||||
onClick={onNewWorkspace}
|
/>
|
||||||
data-testid="new-workspace"
|
|
||||||
>
|
|
||||||
<StyleWorkspaceAdd className="add-icon">
|
|
||||||
<PlusIcon />
|
|
||||||
</StyleWorkspaceAdd>
|
|
||||||
|
|
||||||
<StyleWorkspaceInfo>
|
|
||||||
<StyleWorkspaceTitle>
|
|
||||||
{t['New Workspace']()}
|
|
||||||
</StyleWorkspaceTitle>
|
|
||||||
<p>{t['Create Or Import']()}</p>
|
|
||||||
</StyleWorkspaceInfo>
|
|
||||||
</StyledCreateWorkspaceCard>
|
|
||||||
</div>
|
|
||||||
)}
|
|
||||||
|
|
||||||
{environment.isDesktop && (
|
|
||||||
<Menu
|
|
||||||
placement="auto"
|
|
||||||
trigger={['click']}
|
|
||||||
zIndex={1000}
|
|
||||||
content={
|
|
||||||
<StyledCreateWorkspaceCardPillContainer>
|
|
||||||
<StyledCreateWorkspaceCardPill>
|
|
||||||
<MenuItem
|
|
||||||
style={{
|
|
||||||
height: 'auto',
|
|
||||||
padding: '8px 12px',
|
|
||||||
}}
|
|
||||||
onClick={onNewWorkspace}
|
|
||||||
data-testid="new-workspace"
|
|
||||||
>
|
|
||||||
<StyledCreateWorkspaceCardPillContent>
|
|
||||||
<div>
|
|
||||||
<p>{t['New Workspace']()}</p>
|
|
||||||
<StyledCreateWorkspaceCardPillTextSecondary>
|
|
||||||
<p>{t['Create your own workspace']()}</p>
|
|
||||||
</StyledCreateWorkspaceCardPillTextSecondary>
|
|
||||||
</div>
|
|
||||||
<StyledCreateWorkspaceCardPillIcon>
|
|
||||||
<PlusIcon />
|
|
||||||
</StyledCreateWorkspaceCardPillIcon>
|
|
||||||
</StyledCreateWorkspaceCardPillContent>
|
|
||||||
</MenuItem>
|
|
||||||
</StyledCreateWorkspaceCardPill>
|
|
||||||
<StyledCreateWorkspaceCardPill>
|
|
||||||
<MenuItem
|
|
||||||
disabled={!environment.isDesktop}
|
|
||||||
onClick={onAddWorkspace}
|
|
||||||
data-testid="add-workspace"
|
|
||||||
style={{
|
|
||||||
height: 'auto',
|
|
||||||
padding: '8px 12px',
|
|
||||||
}}
|
|
||||||
>
|
|
||||||
<StyledCreateWorkspaceCardPillContent>
|
|
||||||
<div>
|
|
||||||
<p>{t['Add Workspace']()}</p>
|
|
||||||
<StyledCreateWorkspaceCardPillTextSecondary>
|
|
||||||
<p>{t['Add Workspace Hint']()}</p>
|
|
||||||
</StyledCreateWorkspaceCardPillTextSecondary>
|
|
||||||
</div>
|
|
||||||
<StyledCreateWorkspaceCardPillIcon>
|
|
||||||
<ImportIcon />
|
|
||||||
</StyledCreateWorkspaceCardPillIcon>
|
|
||||||
</StyledCreateWorkspaceCardPillContent>
|
|
||||||
</MenuItem>
|
|
||||||
</StyledCreateWorkspaceCardPill>
|
|
||||||
</StyledCreateWorkspaceCardPillContainer>
|
|
||||||
}
|
|
||||||
>
|
|
||||||
<StyledCreateWorkspaceCard
|
|
||||||
ref={anchorEL}
|
|
||||||
data-testid="add-or-new-workspace"
|
|
||||||
>
|
|
||||||
<StyleWorkspaceAdd className="add-icon">
|
|
||||||
<PlusIcon />
|
|
||||||
</StyleWorkspaceAdd>
|
|
||||||
|
|
||||||
<StyleWorkspaceInfo>
|
|
||||||
<StyleWorkspaceTitle>
|
|
||||||
{t['New Workspace']()}
|
|
||||||
</StyleWorkspaceTitle>
|
|
||||||
<p>{t['Create Or Import']()}</p>
|
|
||||||
</StyleWorkspaceInfo>
|
|
||||||
</StyledCreateWorkspaceCard>
|
|
||||||
</Menu>
|
|
||||||
)}
|
|
||||||
</StyledModalContent>
|
</StyledModalContent>
|
||||||
</ScrollableContainer>
|
</ScrollableContainer>
|
||||||
<Footer user={user} onLogin={onClickLogin} onLogout={onClickLogout} />
|
<Footer user={user} onLogin={onClickLogin} onLogout={onClickLogout} />
|
||||||
|
|||||||
3
nx.json
3
nx.json
@@ -71,6 +71,9 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"env": "API_SERVER_PROFILE"
|
"env": "API_SERVER_PROFILE"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"env": "ENABLE_SQLITE_PROVIDER"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|||||||
1
packages/env/src/config.ts
vendored
1
packages/env/src/config.ts
vendored
@@ -48,6 +48,7 @@ export const buildFlagsSchema = z.object({
|
|||||||
changelogUrl: z.string(),
|
changelogUrl: z.string(),
|
||||||
enablePreloading: z.boolean(),
|
enablePreloading: z.boolean(),
|
||||||
enableNewSettingModal: z.boolean(),
|
enableNewSettingModal: z.boolean(),
|
||||||
|
enableSQLiteProvider: z.boolean(),
|
||||||
});
|
});
|
||||||
|
|
||||||
export const blockSuiteFeatureFlags = z.object({
|
export const blockSuiteFeatureFlags = z.object({
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
import { DebugLogger } from '@affine/debug';
|
import { DebugLogger } from '@affine/debug';
|
||||||
|
import { config } from '@affine/env';
|
||||||
import type { LocalWorkspace, WorkspaceCRUD } from '@affine/env/workspace';
|
import type { LocalWorkspace, WorkspaceCRUD } from '@affine/env/workspace';
|
||||||
import { WorkspaceFlavour } from '@affine/env/workspace';
|
import { WorkspaceFlavour } from '@affine/env/workspace';
|
||||||
import { nanoid, Workspace as BlockSuiteWorkspace } from '@blocksuite/store';
|
import { nanoid, Workspace as BlockSuiteWorkspace } from '@blocksuite/store';
|
||||||
@@ -111,7 +112,7 @@ export const CRUD: WorkspaceCRUD<WorkspaceFlavour.LOCAL> = {
|
|||||||
: [];
|
: [];
|
||||||
|
|
||||||
// workspaces in desktop
|
// workspaces in desktop
|
||||||
if (window.apis && environment.isDesktop) {
|
if (window.apis && environment.isDesktop && config.enableSQLiteProvider) {
|
||||||
const desktopIds = (await window.apis.workspace.list()).map(([id]) => id);
|
const desktopIds = (await window.apis.workspace.list()).map(([id]) => id);
|
||||||
// the ids maybe a subset of the local storage
|
// the ids maybe a subset of the local storage
|
||||||
const moreWorkspaces = desktopIds.filter(
|
const moreWorkspaces = desktopIds.filter(
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ export const createLocalProviders = (): DocProviderCreator[] => {
|
|||||||
providers.push(createBroadcastChannelProvider);
|
providers.push(createBroadcastChannelProvider);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (environment.isDesktop) {
|
if (environment.isDesktop && config.enableSQLiteProvider) {
|
||||||
providers.push(createSQLiteProvider, createSQLiteDBDownloadProvider);
|
providers.push(createSQLiteProvider, createSQLiteDBDownloadProvider);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user