Skip to content

Commit 7d7f66a

Browse files
committed
refactor(appkit): merge FilesPlugin ctor volume loops
Single pass over volumes: connectors, toolkit tools, and policy warnings. Signed-off-by: MarioCadenas <MarioCadenas@users.noreply.github.com>
1 parent 5548292 commit 7d7f66a

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

packages/appkit/src/plugins/files/plugin.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -243,15 +243,11 @@ export class FilesPlugin extends Plugin implements ToolProvider {
243243
telemetry: config.telemetry,
244244
customContentTypes: mergedConfig.customContentTypes,
245245
});
246-
}
247246

248-
for (const volumeKey of this.volumeKeys) {
249-
Object.assign(this.tools, this._defineVolumeTools(volumeKey));
250-
}
247+
Object.assign(this.tools, this._defineVolumeTools(key));
251248

252-
// Warn at startup for volumes without an explicit policy
253-
for (const key of this.volumeKeys) {
254-
if (!volumes[key].policy) {
249+
// Warn at startup for volumes without an explicit policy
250+
if (!volumeCfg.policy) {
255251
logger.warn(
256252
'Volume "%s" has no explicit policy — defaulting to publicRead(). ' +
257253
"Set a policy in files({ volumes: { %s: { policy: ... } } }) to silence this warning.",

0 commit comments

Comments
 (0)