@adminforth/agent 1.33.0 → 1.33.1

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.
package/build.log CHANGED
@@ -40,5 +40,5 @@ custom/skills/fetch_data/SKILL.md
40
40
  custom/skills/mutate_data/
41
41
  custom/skills/mutate_data/SKILL.md
42
42
 
43
- sent 210,589 bytes received 585 bytes 422,348.00 bytes/sec
44
- total size is 208,179 speedup is 0.99
43
+ sent 211,007 bytes received 585 bytes 423,184.00 bytes/sec
44
+ total size is 208,637 speedup is 0.99
@@ -240,7 +240,12 @@ onMounted(async () => {
240
240
  window.visualViewport?.addEventListener('scroll', updateHeight);
241
241
  updateHeight();
242
242
  textInput.value?.focus();
243
- const isTeleportedToBodyFromLocalStorage = agentStore.getLocalStorageItem('isTeleportedToBody') === 'true' || agentStore.getLocalStorageItem('isTeleportedToBodyBeforeFullScreen') === 'true';
243
+ const savedIsTeleportedToBody = agentStore.getLocalStorageItem('isTeleportedToBody');
244
+ const savedIsTeleportedToBodyBeforeFullScreen = agentStore.getLocalStorageItem('isTeleportedToBodyBeforeFullScreen');
245
+ let isTeleportedToBodyFromLocalStorage = true;
246
+ if (savedIsTeleportedToBody !== null || savedIsTeleportedToBodyBeforeFullScreen !== null) {
247
+ isTeleportedToBodyFromLocalStorage = savedIsTeleportedToBody === 'true' || savedIsTeleportedToBodyBeforeFullScreen === 'true';
248
+ }
244
249
  if( coreStore.isMobile ) {
245
250
  agentStore.setIsTeleportedToBody(false);
246
251
  } else {
@@ -116,13 +116,16 @@ export const useAgentStore = defineStore('agent', () => {
116
116
  }
117
117
  }
118
118
  }
119
- setIsTeleportedToBody(getLocalStorageItem('isTeleportedToBody') === 'true' || getLocalStorageItem('isTeleportedToBodyBeforeFullScreen') === 'true');
119
+ const savedIsTeleportedToBody = getLocalStorageItem('isTeleportedToBody');
120
+ const savedIsChatOpen = getLocalStorageItem('isChatOpen');
121
+ const shouldTeleportToBody = savedIsTeleportedToBody === null ? true : savedIsTeleportedToBody === 'true';
122
+ setIsTeleportedToBody(shouldTeleportToBody);
120
123
  lastSessionId.value = getLocalStorageItem('lastSessionId');
121
124
  if (lastSessionId.value && lastSessionId.value !== 'pre-session') {
122
125
  setActiveSession(lastSessionId.value);
123
126
  }
124
127
  if (isTeleportedToBody.value) {
125
- isChatOpen.value = getLocalStorageItem('isChatOpen') === 'true';
128
+ isChatOpen.value = savedIsChatOpen === null ? true : savedIsChatOpen === 'true';
126
129
  }
127
130
  if (coreStore.isMobile) {
128
131
  setChatWidth(window.innerWidth);
@@ -240,7 +240,12 @@ onMounted(async () => {
240
240
  window.visualViewport?.addEventListener('scroll', updateHeight);
241
241
  updateHeight();
242
242
  textInput.value?.focus();
243
- const isTeleportedToBodyFromLocalStorage = agentStore.getLocalStorageItem('isTeleportedToBody') === 'true' || agentStore.getLocalStorageItem('isTeleportedToBodyBeforeFullScreen') === 'true';
243
+ const savedIsTeleportedToBody = agentStore.getLocalStorageItem('isTeleportedToBody');
244
+ const savedIsTeleportedToBodyBeforeFullScreen = agentStore.getLocalStorageItem('isTeleportedToBodyBeforeFullScreen');
245
+ let isTeleportedToBodyFromLocalStorage = true;
246
+ if (savedIsTeleportedToBody !== null || savedIsTeleportedToBodyBeforeFullScreen !== null) {
247
+ isTeleportedToBodyFromLocalStorage = savedIsTeleportedToBody === 'true' || savedIsTeleportedToBodyBeforeFullScreen === 'true';
248
+ }
244
249
  if( coreStore.isMobile ) {
245
250
  agentStore.setIsTeleportedToBody(false);
246
251
  } else {
@@ -116,13 +116,16 @@ export const useAgentStore = defineStore('agent', () => {
116
116
  }
117
117
  }
118
118
  }
119
- setIsTeleportedToBody(getLocalStorageItem('isTeleportedToBody') === 'true' || getLocalStorageItem('isTeleportedToBodyBeforeFullScreen') === 'true');
119
+ const savedIsTeleportedToBody = getLocalStorageItem('isTeleportedToBody');
120
+ const savedIsChatOpen = getLocalStorageItem('isChatOpen');
121
+ const shouldTeleportToBody = savedIsTeleportedToBody === null ? true : savedIsTeleportedToBody === 'true';
122
+ setIsTeleportedToBody(shouldTeleportToBody);
120
123
  lastSessionId.value = getLocalStorageItem('lastSessionId');
121
124
  if (lastSessionId.value && lastSessionId.value !== 'pre-session') {
122
125
  setActiveSession(lastSessionId.value);
123
126
  }
124
127
  if (isTeleportedToBody.value) {
125
- isChatOpen.value = getLocalStorageItem('isChatOpen') === 'true';
128
+ isChatOpen.value = savedIsChatOpen === null ? true : savedIsChatOpen === 'true';
126
129
  }
127
130
  if (coreStore.isMobile) {
128
131
  setChatWidth(window.innerWidth);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adminforth/agent",
3
- "version": "1.33.0",
3
+ "version": "1.33.1",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "type": "module",