mirror of
https://gitee.com/ByteDance/flowgram.ai.git
synced 2025-07-07 17:43:29 +08:00
fix: history parent container get (#150)
This commit is contained in:
parent
4bb3270f2d
commit
7275dcb6d4
@ -22,8 +22,13 @@ export const HistoryContainerModule = new ContainerModule(
|
|||||||
bind(HistoryConfig).toSelf().inSingletonScope();
|
bind(HistoryConfig).toSelf().inSingletonScope();
|
||||||
|
|
||||||
onActivation(HistoryService, (ctx, historyService) => {
|
onActivation(HistoryService, (ctx, historyService) => {
|
||||||
const historyManager =
|
let historyManager;
|
||||||
ctx.container?.parent?.get(HistoryManager) || ctx.container.get(HistoryManager);
|
|
||||||
|
if (ctx.container?.parent?.isBound(HistoryManager)) {
|
||||||
|
historyManager = ctx.container?.parent?.get(HistoryManager);
|
||||||
|
} else {
|
||||||
|
historyManager = ctx.container.get(HistoryManager);
|
||||||
|
}
|
||||||
|
|
||||||
if (!historyManager) {
|
if (!historyManager) {
|
||||||
return historyService;
|
return historyService;
|
||||||
@ -33,5 +38,5 @@ export const HistoryContainerModule = new ContainerModule(
|
|||||||
historyManager.registerHistoryService(historyService);
|
historyManager.registerHistoryService(historyService);
|
||||||
return historyService;
|
return historyService;
|
||||||
});
|
});
|
||||||
},
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user