@kodaris/krubble-app-components 1.0.88 → 1.0.89

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.
@@ -5864,29 +5864,17 @@
5864
5864
  super.connectedCallback();
5865
5865
  // Default to loading a conversation's messages when the consumer hasn't
5866
5866
  // provided their own `load`. With `conversationId` set we rebuild that
5867
- // conversation; with none set we resume the caller's most recent one via
5868
- // `/conversation/last` (KRHttp rejects its 404 when they have none yet →
5869
- // stays null → empty chat) and pin it so this session continues it. Rows
5870
- // already match KRChatbotMessage ({ type, content }); we only parse each row's
5867
+ // conversation; with none set the user wants a NEW conversation, so we start
5868
+ // blank (no resume — the first message creates one via `send`). Rows already
5869
+ // match KRChatbotMessage ({ type, content }); we only parse each row's
5871
5870
  // `conversationFileIDs` (a JSON array string of ids) into `conversationFiles`.
5872
5871
  if (!this.load) {
5873
5872
  this.load = () => {
5874
- let resolve = Promise.resolve();
5875
5873
  if (this.conversationId == null) {
5876
- resolve = krubbleHttp.Http.fetch({ url: '/api/system/conversation/last' })
5877
- .then((r) => r.json())
5878
- .then((res) => {
5879
- this.conversationId = res?.data?.conversationID ?? null;
5880
- })
5881
- .catch(() => { });
5874
+ return Promise.resolve([]);
5882
5875
  }
5883
- return resolve
5884
- .then(() => {
5885
- if (this.conversationId == null) {
5886
- return { data: [] };
5887
- }
5888
- return krubbleHttp.Http.fetch({ url: `/api/system/conversation/${this.conversationId}/messages` }).then((r) => r.json());
5889
- })
5876
+ return krubbleHttp.Http.fetch({ url: `/api/system/conversation/${this.conversationId}/messages` })
5877
+ .then((r) => r.json())
5890
5878
  .then((res) => Promise.all((res?.data || []).map((msg) => {
5891
5879
  // Resolve this message's `conversationFileIDs` (a JSON array string of
5892
5880
  // ids) into full file objects — each fetch response IS the