fix(mobile): support Android system file picker
This commit is contained in:
@@ -137,6 +137,7 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, ref } from 'vue';
|
||||
import { onHide, onShow, onUnload } from '@dcloudio/uni-app';
|
||||
import { isPlatformFileSelectionActive } from '@/services/file-selection-lifecycle';
|
||||
import type {
|
||||
AsrResponse,
|
||||
InterviewFinishResponse,
|
||||
@@ -500,7 +501,7 @@ onShow(() => {
|
||||
|
||||
onHide(() => {
|
||||
speechPlayback.stop();
|
||||
cancelQuestionRecording();
|
||||
if (!isPlatformFileSelectionActive()) cancelQuestionRecording();
|
||||
});
|
||||
|
||||
onUnload(() => {
|
||||
|
||||
@@ -503,6 +503,7 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, nextTick, ref } from 'vue';
|
||||
import { onHide, onShow, onUnload } from '@dcloudio/uni-app';
|
||||
import { isPlatformFileSelectionActive } from '@/services/file-selection-lifecycle';
|
||||
import ChatComposer from '@/components/chat/ChatComposer.vue';
|
||||
import RealtimePracticeAppBridge from '@/components/practice/RealtimePracticeAppBridge.vue';
|
||||
import type {
|
||||
@@ -1851,7 +1852,7 @@ onHide(() => {
|
||||
stopRealtime();
|
||||
invalidateRequests();
|
||||
speechPlayback.stop();
|
||||
cancelRecording();
|
||||
if (!isPlatformFileSelectionActive()) cancelRecording();
|
||||
});
|
||||
|
||||
onUnload(() => {
|
||||
|
||||
@@ -231,6 +231,7 @@
|
||||
import { computed, nextTick, ref } from 'vue';
|
||||
import { onHide, onShow, onUnload } from '@dcloudio/uni-app';
|
||||
import ChatComposer from '@/components/chat/ChatComposer.vue';
|
||||
import { isPlatformFileSelectionActive } from '@/services/file-selection-lifecycle';
|
||||
import { isLoggedIn, rememberLoginRedirect } from '@/services/auth';
|
||||
import { chooseKnowledgeMedia } from '@/services/knowledge';
|
||||
import { resetPageScroll } from '@/services/navigation';
|
||||
@@ -769,13 +770,15 @@ const goLogin = () => {
|
||||
uni.navigateTo({ url: '/pages/auth/login/index' });
|
||||
};
|
||||
|
||||
const teardown = () => {
|
||||
const teardown = (preservePlatformFileSelection = false) => {
|
||||
organizeGeneration += 1;
|
||||
uploadGeneration += 1;
|
||||
mediaSelectionGeneration += 1;
|
||||
mineGeneration += 1;
|
||||
submitGeneration += 1;
|
||||
cancelVoiceTranscription();
|
||||
if (!preservePlatformFileSelection) {
|
||||
mediaSelectionGeneration += 1;
|
||||
cancelVoiceTranscription();
|
||||
}
|
||||
activeUploadTask?.abort();
|
||||
activeUploadTask = null;
|
||||
speechPlayback.stop();
|
||||
@@ -784,7 +787,7 @@ const teardown = () => {
|
||||
uploading.value = false;
|
||||
submitting.value = false;
|
||||
loadingMine.value = false;
|
||||
mediaSelecting.value = false;
|
||||
if (!preservePlatformFileSelection) mediaSelecting.value = false;
|
||||
};
|
||||
|
||||
const clearConversationState = () => {
|
||||
@@ -833,7 +836,7 @@ onShow(() => {
|
||||
}
|
||||
});
|
||||
|
||||
onHide(teardown);
|
||||
onHide(() => teardown(isPlatformFileSelectionActive()));
|
||||
onUnload(() => {
|
||||
teardown();
|
||||
speechPlayback.destroy();
|
||||
|
||||
@@ -424,6 +424,7 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, nextTick, ref } from 'vue';
|
||||
import { onHide, onShow, onUnload } from '@dcloudio/uni-app';
|
||||
import { isPlatformFileSelectionActive } from '@/services/file-selection-lifecycle';
|
||||
import type {
|
||||
AnswerFeedbackVerdict,
|
||||
BroadcastKnowledgeContext,
|
||||
@@ -1565,7 +1566,7 @@ onHide(() => {
|
||||
cancelPendingBroadcastConsultation();
|
||||
speechPlayback.stop();
|
||||
composerRef.value?.teardown();
|
||||
cancelVoiceTranscription();
|
||||
if (!isPlatformFileSelectionActive()) cancelVoiceTranscription();
|
||||
cancelPendingMediaSearch();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user