Skip to content

Commit 5a775b2

Browse files
committed
Fix name attribute in dynamic config
1 parent cad8e4f commit 5a775b2

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

config/dynamic.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ module.exports.PluginConfig = class PluginConfig {
155155
if (typeof fn !== "function" || fn.name in ignoredMethods) return;
156156
this[fnName] = async (...args) => {
157157
return await ipcRenderer.invoke(
158-
`${this.name}-config-${fnName}`,
158+
`${this.#name}-config-${fnName}`,
159159
...args,
160160
);
161161
};
@@ -166,38 +166,38 @@ module.exports.PluginConfig = class PluginConfig {
166166
}
167167
this.#subscribers[valueName] = fn;
168168
ipcRenderer.on(
169-
`${this.name}-config-changed-${valueName}`,
169+
`${this.#name}-config-changed-${valueName}`,
170170
(_, value) => {
171171
fn(value);
172172
},
173173
);
174-
ipcRenderer.send(`${this.name}-config-subscribe`, valueName);
174+
ipcRenderer.send(`${this.#name}-config-subscribe`, valueName);
175175
};
176176

177177
this.subscribeAll = (fn) => {
178-
ipcRenderer.on(`${this.name}-config-changed`, (_, value) => {
178+
ipcRenderer.on(`${this.#name}-config-changed`, (_, value) => {
179179
fn(value);
180180
});
181-
ipcRenderer.send(`${this.name}-config-subscribe-all`);
181+
ipcRenderer.send(`${this.#name}-config-subscribe-all`);
182182
};
183183
}
184184
} else if (process.type === "browser") {
185185
for (const [fnName, fn] of Object.entries(this)) {
186186
if (typeof fn !== "function" || fn.name in ignoredMethods) return;
187-
ipcMain.handle(`${this.name}-config-${fnName}`, (_, ...args) => {
187+
ipcMain.handle(`${this.#name}-config-${fnName}`, (_, ...args) => {
188188
return fn(...args);
189189
});
190190
}
191191

192-
ipcMain.on(`${this.name}-config-subscribe`, (_, valueName) => {
192+
ipcMain.on(`${this.#name}-config-subscribe`, (_, valueName) => {
193193
this.subscribe(valueName, (value) => {
194-
sendToFront(`${this.name}-config-changed-${valueName}`, value);
194+
sendToFront(`${this.#name}-config-changed-${valueName}`, value);
195195
});
196196
});
197197

198-
ipcMain.on(`${this.name}-config-subscribe-all`, () => {
198+
ipcMain.on(`${this.#name}-config-subscribe-all`, () => {
199199
this.subscribeAll((value) => {
200-
sendToFront(`${this.name}-config-changed`, value);
200+
sendToFront(`${this.#name}-config-changed`, value);
201201
});
202202
});
203203
}

0 commit comments

Comments
 (0)