mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
feat(nbstore): rename SyncStorage to DocSyncStorage (#10751)
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
import { IndexedDBDocStorage, IndexedDBSyncStorage } from '@affine/nbstore/idb';
|
||||
import { SqliteDocStorage, SqliteSyncStorage } from '@affine/nbstore/sqlite';
|
||||
import {
|
||||
IndexedDBDocStorage,
|
||||
IndexedDBDocSyncStorage,
|
||||
} from '@affine/nbstore/idb';
|
||||
import { SqliteDocStorage, SqliteDocSyncStorage } from '@affine/nbstore/sqlite';
|
||||
import type { StoreClient } from '@affine/nbstore/worker/client';
|
||||
import { Entity } from '@toeverything/infra';
|
||||
|
||||
@@ -16,10 +19,10 @@ export class UserDBEngine extends Entity<{
|
||||
BUILD_CONFIG.isElectron || BUILD_CONFIG.isIOS
|
||||
? SqliteDocStorage
|
||||
: IndexedDBDocStorage;
|
||||
SyncStorageType =
|
||||
DocSyncStorageType =
|
||||
BUILD_CONFIG.isElectron || BUILD_CONFIG.isIOS
|
||||
? SqliteSyncStorage
|
||||
: IndexedDBSyncStorage;
|
||||
? SqliteDocSyncStorage
|
||||
: IndexedDBDocSyncStorage;
|
||||
|
||||
canGracefulStop() {
|
||||
// TODO(@eyhn): Implement this
|
||||
@@ -44,8 +47,8 @@ export class UserDBEngine extends Entity<{
|
||||
type: 'userspace',
|
||||
},
|
||||
},
|
||||
sync: {
|
||||
name: this.SyncStorageType.identifier,
|
||||
docSync: {
|
||||
name: this.DocSyncStorageType.identifier,
|
||||
opts: {
|
||||
id: `${serverService.server.id}:` + this.userId,
|
||||
type: 'userspace',
|
||||
|
||||
@@ -14,7 +14,7 @@ import { CloudBlobStorage, StaticCloudDocStorage } from '@affine/nbstore/cloud';
|
||||
import {
|
||||
IndexedDBBlobStorage,
|
||||
IndexedDBDocStorage,
|
||||
IndexedDBSyncStorage,
|
||||
IndexedDBDocSyncStorage,
|
||||
} from '@affine/nbstore/idb';
|
||||
import {
|
||||
IndexedDBV1BlobStorage,
|
||||
@@ -23,7 +23,7 @@ import {
|
||||
import {
|
||||
SqliteBlobStorage,
|
||||
SqliteDocStorage,
|
||||
SqliteSyncStorage,
|
||||
SqliteDocSyncStorage,
|
||||
} from '@affine/nbstore/sqlite';
|
||||
import {
|
||||
SqliteV1BlobStorage,
|
||||
@@ -111,10 +111,10 @@ class CloudWorkspaceFlavourProvider implements WorkspaceFlavourProvider {
|
||||
: BUILD_CONFIG.isWeb || BUILD_CONFIG.isMobileWeb
|
||||
? IndexedDBV1BlobStorage
|
||||
: undefined;
|
||||
SyncStorageType =
|
||||
DocSyncStorageType =
|
||||
BUILD_CONFIG.isElectron || BUILD_CONFIG.isIOS
|
||||
? SqliteSyncStorage
|
||||
: IndexedDBSyncStorage;
|
||||
? SqliteDocSyncStorage
|
||||
: IndexedDBDocSyncStorage;
|
||||
|
||||
async deleteWorkspace(id: string): Promise<void> {
|
||||
await this.graphqlService.gql({
|
||||
@@ -431,8 +431,8 @@ class CloudWorkspaceFlavourProvider implements WorkspaceFlavourProvider {
|
||||
id: workspaceId,
|
||||
},
|
||||
},
|
||||
sync: {
|
||||
name: this.SyncStorageType.identifier,
|
||||
docSync: {
|
||||
name: this.DocSyncStorageType.identifier,
|
||||
opts: {
|
||||
flavour: this.flavour,
|
||||
type: 'workspace',
|
||||
|
||||
@@ -8,7 +8,7 @@ import {
|
||||
import {
|
||||
IndexedDBBlobStorage,
|
||||
IndexedDBDocStorage,
|
||||
IndexedDBSyncStorage,
|
||||
IndexedDBDocSyncStorage,
|
||||
} from '@affine/nbstore/idb';
|
||||
import {
|
||||
IndexedDBV1BlobStorage,
|
||||
@@ -17,7 +17,7 @@ import {
|
||||
import {
|
||||
SqliteBlobStorage,
|
||||
SqliteDocStorage,
|
||||
SqliteSyncStorage,
|
||||
SqliteDocSyncStorage,
|
||||
} from '@affine/nbstore/sqlite';
|
||||
import {
|
||||
SqliteV1BlobStorage,
|
||||
@@ -97,10 +97,10 @@ class LocalWorkspaceFlavourProvider implements WorkspaceFlavourProvider {
|
||||
: BUILD_CONFIG.isWeb || BUILD_CONFIG.isMobileWeb
|
||||
? IndexedDBV1BlobStorage
|
||||
: undefined;
|
||||
SyncStorageType =
|
||||
DocSyncStorageType =
|
||||
BUILD_CONFIG.isElectron || BUILD_CONFIG.isIOS
|
||||
? SqliteSyncStorage
|
||||
: IndexedDBSyncStorage;
|
||||
? SqliteDocSyncStorage
|
||||
: IndexedDBDocSyncStorage;
|
||||
|
||||
async deleteWorkspace(id: string): Promise<void> {
|
||||
setLocalWorkspaceIds(ids => ids.filter(x => x !== id));
|
||||
@@ -321,8 +321,8 @@ class LocalWorkspaceFlavourProvider implements WorkspaceFlavourProvider {
|
||||
id: workspaceId,
|
||||
},
|
||||
},
|
||||
sync: {
|
||||
name: this.SyncStorageType.identifier,
|
||||
docSync: {
|
||||
name: this.DocSyncStorageType.identifier,
|
||||
opts: {
|
||||
flavour: this.flavour,
|
||||
type: 'workspace',
|
||||
|
||||
Reference in New Issue
Block a user