docs: improve doucmentation
improve doucmentation and fix small store changes
This commit is contained in:
@@ -213,6 +213,10 @@ export class PluginStoreService {
|
||||
? await this.installedPluginsForServer(targetServerId)
|
||||
: this.installedPluginsForScope(installScope);
|
||||
const existing = currentScopePlugins.find((candidate) => candidate.manifest.id === manifest.id);
|
||||
const installOptions = {
|
||||
...options,
|
||||
activate: options.activate === true || (installScope === 'server' && !existing)
|
||||
};
|
||||
const installedPlugin = await this.cacheInstalledPlugin({
|
||||
bundleUrl: manifest.bundle?.url ?? plugin.bundleUrl,
|
||||
installedAt: existing?.installedAt ?? now,
|
||||
@@ -226,8 +230,8 @@ export class PluginStoreService {
|
||||
.concat(installedPlugin)
|
||||
.sort(sortInstalledPlugins);
|
||||
|
||||
await this.persistInstallResult(installScope, targetServerId, nextInstalledPlugins, installedPlugin, options);
|
||||
await this.registerInstallResult(installScope, targetServerId, nextInstalledPlugins, installedPlugin, options);
|
||||
await this.persistInstallResult(installScope, targetServerId, nextInstalledPlugins, installedPlugin, installOptions);
|
||||
await this.registerInstallResult(installScope, targetServerId, nextInstalledPlugins, installedPlugin, installOptions);
|
||||
|
||||
return installedPlugin;
|
||||
}
|
||||
@@ -272,6 +276,10 @@ export class PluginStoreService {
|
||||
await this.writeLocalServerInstalledPlugins(targetServerId, nextInstalledPlugins);
|
||||
}
|
||||
|
||||
if (installScope === 'server' && options.activate) {
|
||||
this.registry.setEnabled(installedPlugin.manifest.id, true);
|
||||
}
|
||||
|
||||
if (installScope !== 'client' && targetServerId !== this.currentRoomId?.()) {
|
||||
if (options.activate) {
|
||||
await this.host.rememberActivation(installedPlugin.manifest.id);
|
||||
@@ -367,6 +375,7 @@ export class PluginStoreService {
|
||||
|
||||
if (options.activate) {
|
||||
for (const installedPlugin of installedPlugins) {
|
||||
this.registry.setEnabled(installedPlugin.manifest.id, true);
|
||||
await this.host.rememberActivation(installedPlugin.manifest.id);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user