mirror of
https://github.com/Minidoracat/mcp-feedback-enhanced.git
synced 2025-07-27 10:42:25 +08:00
🐛 修復初始化順序
This commit is contained in:
parent
4eb528cb46
commit
2a7538c0b2
@ -58,20 +58,7 @@
|
|||||||
SessionManager.prototype.initializeModules = function(options) {
|
SessionManager.prototype.initializeModules = function(options) {
|
||||||
const self = this;
|
const self = this;
|
||||||
|
|
||||||
// 初始化數據管理器
|
// 先初始化 UI 渲染器(避免數據管理器回調時 UI 組件尚未準備好)
|
||||||
this.dataManager = new window.MCPFeedback.Session.DataManager({
|
|
||||||
onSessionChange: function(sessionData) {
|
|
||||||
self.handleSessionChange(sessionData);
|
|
||||||
},
|
|
||||||
onHistoryChange: function(history) {
|
|
||||||
self.handleHistoryChange(history);
|
|
||||||
},
|
|
||||||
onStatsChange: function(stats) {
|
|
||||||
self.handleStatsChange(stats);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// 初始化 UI 渲染器
|
|
||||||
this.uiRenderer = new window.MCPFeedback.Session.UIRenderer({
|
this.uiRenderer = new window.MCPFeedback.Session.UIRenderer({
|
||||||
showFullSessionId: options.showFullSessionId || false,
|
showFullSessionId: options.showFullSessionId || false,
|
||||||
enableAnimations: options.enableAnimations !== false
|
enableAnimations: options.enableAnimations !== false
|
||||||
@ -83,6 +70,19 @@
|
|||||||
enableBackdropClose: options.enableBackdropClose !== false,
|
enableBackdropClose: options.enableBackdropClose !== false,
|
||||||
showFullSessionId: options.showFullSessionId || false
|
showFullSessionId: options.showFullSessionId || false
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// 最後初始化數據管理器(確保 UI 組件已準備好接收回調)
|
||||||
|
this.dataManager = new window.MCPFeedback.Session.DataManager({
|
||||||
|
onSessionChange: function(sessionData) {
|
||||||
|
self.handleSessionChange(sessionData);
|
||||||
|
},
|
||||||
|
onHistoryChange: function(history) {
|
||||||
|
self.handleHistoryChange(history);
|
||||||
|
},
|
||||||
|
onStatsChange: function(stats) {
|
||||||
|
self.handleStatsChange(stats);
|
||||||
|
}
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user