mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-21 20:16:26 +08:00
fad49bb070
AudioMedia entity for loading & controlling a single audio media AudioMediaManagerService: Global audio state synchronization across tabs AudioAttachmentService + AudioAttachmentBlock for manipulating AttachmentBlock in affine - e.g., filling transcription (using mock endpoint for now) Added AudioBlock + AudioPlayer for rendering audio block in affine (new transcription block whose renderer is provided in affine) fix AF-2292 fix AF-2337
24 lines
749 B
TypeScript
24 lines
749 B
TypeScript
import { GlobalContextService } from '@affine/core/modules/global-context';
|
|
import { WorkspacesService } from '@affine/core/modules/workspace';
|
|
import type { FrameworkProvider } from '@toeverything/infra';
|
|
|
|
export function getCurrentWorkspace(frameworkProvider: FrameworkProvider) {
|
|
const currentWorkspaceId = frameworkProvider
|
|
.get(GlobalContextService)
|
|
.globalContext.workspaceId.get();
|
|
const workspacesService = frameworkProvider.get(WorkspacesService);
|
|
const workspaceRef = currentWorkspaceId
|
|
? workspacesService.openByWorkspaceId(currentWorkspaceId)
|
|
: null;
|
|
if (!workspaceRef) {
|
|
return;
|
|
}
|
|
const { workspace, dispose } = workspaceRef;
|
|
|
|
return {
|
|
workspace,
|
|
dispose,
|
|
[Symbol.dispose]: dispose,
|
|
};
|
|
}
|