mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-23 21:38:44 +08:00
feat(editor): audio block (#10947)
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
This commit is contained in:
@@ -24,7 +24,7 @@ import {
|
||||
} from 'rxjs';
|
||||
|
||||
import { isMacOS } from '../../shared/utils';
|
||||
import { beforeAppQuit } from '../cleanup';
|
||||
import { beforeAppQuit, onTabClose } from '../cleanup';
|
||||
import { mainWindowOrigin, shellViewUrl } from '../constants';
|
||||
import { ensureHelperProcess } from '../helper-process';
|
||||
import { logger } from '../logger';
|
||||
@@ -400,6 +400,8 @@ export class WebContentViewsManager {
|
||||
});
|
||||
}
|
||||
}, 500); // delay a bit to get rid of the flicker
|
||||
|
||||
onTabClose(id);
|
||||
};
|
||||
|
||||
undoCloseTab = async () => {
|
||||
@@ -1052,6 +1054,13 @@ export const loadUrlInActiveTab = async (_url: string) => {
|
||||
// todo: implement
|
||||
throw new Error('loadUrlInActiveTab not implemented');
|
||||
};
|
||||
export const ensureTabLoaded = async (tabId: string) => {
|
||||
const tab = WebContentViewsManager.instance.tabViewsMap.get(tabId);
|
||||
if (tab) {
|
||||
return tab;
|
||||
}
|
||||
return WebContentViewsManager.instance.loadTab(tabId);
|
||||
};
|
||||
export const showTab = WebContentViewsManager.instance.showTab;
|
||||
export const closeTab = WebContentViewsManager.instance.closeTab;
|
||||
export const undoCloseTab = WebContentViewsManager.instance.undoCloseTab;
|
||||
|
||||
Reference in New Issue
Block a user