@olares/lares-mobile 0.15.39 → 0.15.40
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/package.json +2 -2
- package/src/App.vue +10 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@olares/lares-mobile",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.40",
|
|
4
4
|
"description": "Lares chat component for LarePass",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"vue": "^3.2.0"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@olares/lares-core": "0.15.
|
|
31
|
+
"@olares/lares-core": "0.15.40",
|
|
32
32
|
"markdown-it": "^14.3.0"
|
|
33
33
|
}
|
|
34
34
|
}
|
package/src/App.vue
CHANGED
|
@@ -119,7 +119,7 @@ import { subscribeVoiceSettings } from "@olares/lares-core/larepass/settings";
|
|
|
119
119
|
import { createVoicePanel } from "@olares/lares-core/voice/panel";
|
|
120
120
|
import { mergeVoiceTranscript, subscribeVoiceHistory } from "@olares/lares-core/voice/projection";
|
|
121
121
|
import LaresVoicePanel from "./chat/VoicePanel.vue";
|
|
122
|
-
import { pickHostPorts } from "@olares/lares-core/larepass/host";
|
|
122
|
+
import { pickHostPorts, isTransportFault } from "@olares/lares-core/larepass/host";
|
|
123
123
|
import { connectChat } from "./runtime.js";
|
|
124
124
|
import { createT } from "./i18n.js";
|
|
125
125
|
import { failText, withPendingUser } from "./chat/format.js";
|
|
@@ -640,7 +640,7 @@ export default {
|
|
|
640
640
|
if (document.hidden) {
|
|
641
641
|
// A locked screen or an app switch is a pause, not the end of the
|
|
642
642
|
// answer: stopping here marks the utterance read and it never resumes.
|
|
643
|
-
if (this.reader.
|
|
643
|
+
if (this.reader.pause()) this.voiceReadoutPaused = true;
|
|
644
644
|
void this.voicePanel.pause().catch(() => {});
|
|
645
645
|
return;
|
|
646
646
|
}
|
|
@@ -648,13 +648,13 @@ export default {
|
|
|
648
648
|
if (this.voiceReadoutPaused) { this.voiceReadoutPaused = false; this.reader.resume(); }
|
|
649
649
|
};
|
|
650
650
|
this.voicePageHideHandler = () => {
|
|
651
|
-
if (this.reader.
|
|
651
|
+
if (this.reader.pause()) this.voiceReadoutPaused = true;
|
|
652
652
|
void this.voicePanel.pause().catch(() => {});
|
|
653
653
|
};
|
|
654
654
|
this.voicePageShowHandler = () => {
|
|
655
655
|
if (this.voiceReadoutPaused) { this.voiceReadoutPaused = false; this.reader.resume(); }
|
|
656
656
|
};
|
|
657
|
-
this.voiceOfflineHandler = () => {
|
|
657
|
+
this.voiceOfflineHandler = () => { void this.voicePanel.pause().catch(() => {}); };
|
|
658
658
|
window.addEventListener("offline", this.voiceOfflineHandler);
|
|
659
659
|
document.addEventListener("visibilitychange", this.voiceVisibilityHandler);
|
|
660
660
|
window.addEventListener("pagehide", this.voicePageHideHandler);
|
|
@@ -1653,7 +1653,8 @@ export default {
|
|
|
1653
1653
|
this.draft = text;
|
|
1654
1654
|
this.draftImages = images;
|
|
1655
1655
|
}
|
|
1656
|
-
|
|
1656
|
+
const fault = sent.error?.message || sent.error?.code || "send";
|
|
1657
|
+
if (!isTransportFault(fault)) this.failed = fault;
|
|
1657
1658
|
} else {
|
|
1658
1659
|
for (const image of images) URL.revokeObjectURL(image.previewUrl);
|
|
1659
1660
|
}
|
|
@@ -1665,7 +1666,8 @@ export default {
|
|
|
1665
1666
|
this.draft = text;
|
|
1666
1667
|
this.draftImages = images;
|
|
1667
1668
|
}
|
|
1668
|
-
|
|
1669
|
+
const fault = err instanceof Error ? err.message : "attachment";
|
|
1670
|
+
if (!isTransportFault(fault)) this.failed = fault;
|
|
1669
1671
|
} finally {
|
|
1670
1672
|
this.sending = false;
|
|
1671
1673
|
}
|
|
@@ -1696,7 +1698,8 @@ export default {
|
|
|
1696
1698
|
try {
|
|
1697
1699
|
const stopped = await this.runtime.cancel();
|
|
1698
1700
|
if (!stopped.ok) {
|
|
1699
|
-
|
|
1701
|
+
const fault = stopped.error?.message || stopped.error?.code || "cancel";
|
|
1702
|
+
if (!isTransportFault(fault)) this.failed = fault;
|
|
1700
1703
|
}
|
|
1701
1704
|
} finally {
|
|
1702
1705
|
this.stopping = false;
|