odant-work 1.0.112 → 1.0.114

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.
@@ -313,9 +313,10 @@ export default {
313
313
  if (this.$item && this._onChanged)
314
314
  this.$item.unlisten?.('changed', this._onChanged);
315
315
  },
316
- async reload() {
316
+ async reload({ force = false } = {}) {
317
317
  const item = this.$item;
318
318
  if (!item || typeof item.fetch !== 'function') {
319
+ this._layersSig = '';
319
320
  this.aiRoot = null;
320
321
  return;
321
322
  }
@@ -333,9 +334,14 @@ export default {
333
334
  return;
334
335
  const valid = resolved.filter(Boolean);
335
336
  if (!valid.length) {
337
+ this._layersSig = '';
336
338
  this.aiRoot = null;
337
339
  return;
338
340
  }
341
+ const sig = valid.map(v => `${v.item.path}|${v.scope}|${v.isOwn}`).join(';');
342
+ if (!force && this.aiRoot && this._layersSig === sig)
343
+ return;
344
+ this._layersSig = sig;
339
345
  const ownAiPath = (item.meta_folder?.path || item.path || '') + '/ai';
340
346
  this.aiRoot = buildMergedLayerFolder(valid, {
341
347
  id: 'ai',
@@ -343,8 +349,10 @@ export default {
343
349
  path: ownAiPath,
344
350
  });
345
351
  } catch {
346
- if (seq === this._reloadSeq)
352
+ if (seq === this._reloadSeq) {
353
+ this._layersSig = '';
347
354
  this.aiRoot = null;
355
+ }
348
356
  }
349
357
  },
350
358
  async openImportDialog() {
@@ -352,7 +360,7 @@ export default {
352
360
  return;
353
361
  const dlg = ODA.createComponent(SKILL_IMPORT_MODAL_TAG, {
354
362
  $item: this.$item,
355
- onInstalled: () => this.reload(),
363
+ onInstalled: () => this.reload({ force: true }),
356
364
  });
357
365
  try {
358
366
  await WORK.showModal(dlg, {