floating-live 0.17.0-alpha.1 → 0.17.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -144,7 +144,7 @@ export class CommonPluginContext {
|
|
|
144
144
|
}
|
|
145
145
|
on(type, listener) {
|
|
146
146
|
try {
|
|
147
|
-
__classPrivateFieldGet(this, _CommonPluginContext_app, "f").on(type, listener);
|
|
147
|
+
__classPrivateFieldGet(this, _CommonPluginContext_app, "f").on(type, listener, this.signal);
|
|
148
148
|
__classPrivateFieldGet(this, _CommonPluginContext_registered, "f").events.addItem(type, listener);
|
|
149
149
|
}
|
|
150
150
|
catch (err) {
|
|
@@ -153,7 +153,7 @@ export class CommonPluginContext {
|
|
|
153
153
|
}
|
|
154
154
|
once(type, listener) {
|
|
155
155
|
try {
|
|
156
|
-
__classPrivateFieldGet(this, _CommonPluginContext_app, "f").once(type, listener);
|
|
156
|
+
__classPrivateFieldGet(this, _CommonPluginContext_app, "f").once(type, listener, this.signal);
|
|
157
157
|
__classPrivateFieldGet(this, _CommonPluginContext_registered, "f").events.addItem(type, listener);
|
|
158
158
|
}
|
|
159
159
|
catch (err) {
|
|
@@ -278,7 +278,7 @@ export class CommonPluginContext {
|
|
|
278
278
|
});
|
|
279
279
|
const { plugins, values, hooks, commands } = __classPrivateFieldGet(this, _CommonPluginContext_registered, "f");
|
|
280
280
|
plugins.forEach((pluginName) => __classPrivateFieldGet(this, _CommonPluginContext_app, "f").unregister(pluginName));
|
|
281
|
-
hooks.forEach((hookList, name) => hookList.forEach((hookFunc) => __classPrivateFieldGet(this, _CommonPluginContext_app, "f").
|
|
281
|
+
hooks.forEach((hookList, name) => hookList.forEach((hookFunc) => __classPrivateFieldGet(this, _CommonPluginContext_app, "f").unuseHook(name, hookFunc)));
|
|
282
282
|
commands.forEach((name) => __classPrivateFieldGet(this, _CommonPluginContext_app, "f").unregisterCommand(name));
|
|
283
283
|
values.forEach((name) => __classPrivateFieldGet(this, _CommonPluginContext_app, "f").unregisterValue(name));
|
|
284
284
|
__classPrivateFieldGet(this, _CommonPluginContext_abortController, "f").abort();
|
package/dist/plugin/manager.js
CHANGED
|
@@ -189,8 +189,8 @@ export class PluginManager {
|
|
|
189
189
|
this.whenRegisterMap.set(pluginName, new Map([[callback, null]]));
|
|
190
190
|
}
|
|
191
191
|
else {
|
|
192
|
-
//
|
|
193
|
-
if (
|
|
192
|
+
// 确保回调函数不重复注册,如果重复,则直接返回
|
|
193
|
+
if (this.whenRegisterMap.get(pluginName).has(callback)) {
|
|
194
194
|
return;
|
|
195
195
|
}
|
|
196
196
|
// 如果目标插件的回调列表已存在,直接添加回调函数
|