@fluid-topics/ft-reader-attachments 1.2.50 → 1.2.52

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.
@@ -15,5 +15,6 @@ export declare class FtReaderAttachments extends FtReaderAttachments_base implem
15
15
  constructor();
16
16
  protected render(): typeof nothing | import("lit-html").TemplateResult<1>;
17
17
  protected update(props: PropertyValues): void;
18
+ private updateAttachments;
18
19
  }
19
20
  export {};
@@ -6,9 +6,9 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
6
6
  };
7
7
  import { html, nothing } from "lit";
8
8
  import { property, state } from "lit/decorators.js";
9
- import { last, redux } from "@fluid-topics/ft-wc-utils";
9
+ import { last, redux, reduxEventListener } from "@fluid-topics/ft-wc-utils";
10
10
  import { styles } from "./ft-reader-attachments.styles";
11
- import { FtReaderComponent } from "@fluid-topics/ft-reader-context/build/registration";
11
+ import { FtReaderComponent, FtReaderStoreEvents } from "@fluid-topics/ft-reader-context/build/registration";
12
12
  import { repeat } from "lit/directives/repeat.js";
13
13
  import { attachmentsMessages, defaultMessages } from "./DesignedReaderAttachmentsMessages";
14
14
  import { fileFormatColors, FtFileFormatIcons, FtIcon, resolveFileFormatIcon } from "@fluid-topics/ft-icon";
@@ -67,15 +67,18 @@ class FtReaderAttachments extends withI18n(FtReaderComponent) {
67
67
  return nothing;
68
68
  }
69
69
  update(props) {
70
- var _a;
71
70
  super.update(props);
72
71
  if (props.has("map")) {
73
- if (this.map) {
74
- (_a = this.service) === null || _a === void 0 ? void 0 : _a.getAttachments().then(attachments => this.attachments = attachments);
75
- }
76
- else {
77
- this.attachments = undefined;
78
- }
72
+ this.updateAttachments();
73
+ }
74
+ }
75
+ updateAttachments() {
76
+ var _a;
77
+ if (this.map) {
78
+ (_a = this.service) === null || _a === void 0 ? void 0 : _a.getAttachments().then(attachments => this.attachments = attachments);
79
+ }
80
+ else {
81
+ this.attachments = undefined;
79
82
  }
80
83
  }
81
84
  }
@@ -100,4 +103,7 @@ __decorate([
100
103
  __decorate([
101
104
  state()
102
105
  ], FtReaderAttachments.prototype, "attachments", void 0);
106
+ __decorate([
107
+ reduxEventListener({ eventName: FtReaderStoreEvents.mapAttachmentsUpdate })
108
+ ], FtReaderAttachments.prototype, "updateAttachments", null);
103
109
  export { FtReaderAttachments };