feat(release): close handler and microphone gaps
This commit is contained in:
@@ -137,7 +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 { isPlatformNativeActivityActive } from '@/services/file-selection-lifecycle';
|
||||
import type {
|
||||
AsrResponse,
|
||||
InterviewFinishResponse,
|
||||
@@ -501,7 +501,7 @@ onShow(() => {
|
||||
|
||||
onHide(() => {
|
||||
speechPlayback.stop();
|
||||
if (!isPlatformFileSelectionActive()) cancelQuestionRecording();
|
||||
if (!isPlatformNativeActivityActive()) cancelQuestionRecording();
|
||||
});
|
||||
|
||||
onUnload(() => {
|
||||
|
||||
@@ -177,6 +177,7 @@ import { resetPageScroll } from '@/services/navigation';
|
||||
import { createPageRequestScope } from '@/services/request-scope';
|
||||
import { startSpeechCapture, type SpeechCapture, type SpeechCaptureSession } from '@/services/speech-capture';
|
||||
import { transcribeSpeechCapture } from '@/services/speech';
|
||||
import { isPlatformNativeActivityActive } from '@/services/file-selection-lifecycle';
|
||||
|
||||
const path = '/pages/user/direct/index';
|
||||
const pageSize = 20;
|
||||
@@ -485,7 +486,7 @@ onShow(async () => {
|
||||
});
|
||||
onHide(() => {
|
||||
requests.invalidate();
|
||||
teardownVoice();
|
||||
if (!isPlatformNativeActivityActive()) teardownVoice();
|
||||
});
|
||||
onUnload(() => {
|
||||
requests.invalidate();
|
||||
|
||||
@@ -503,7 +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 { isPlatformNativeActivityActive } from '@/services/file-selection-lifecycle';
|
||||
import ChatComposer from '@/components/chat/ChatComposer.vue';
|
||||
import RealtimePracticeAppBridge from '@/components/practice/RealtimePracticeAppBridge.vue';
|
||||
import type {
|
||||
@@ -1852,7 +1852,7 @@ onHide(() => {
|
||||
stopRealtime();
|
||||
invalidateRequests();
|
||||
speechPlayback.stop();
|
||||
if (!isPlatformFileSelectionActive()) cancelRecording();
|
||||
if (!isPlatformNativeActivityActive()) cancelRecording();
|
||||
});
|
||||
|
||||
onUnload(() => {
|
||||
|
||||
@@ -231,7 +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 { isPlatformNativeActivityActive } from '@/services/file-selection-lifecycle';
|
||||
import { isLoggedIn, rememberLoginRedirect } from '@/services/auth';
|
||||
import { chooseKnowledgeMedia } from '@/services/knowledge';
|
||||
import { resetPageScroll } from '@/services/navigation';
|
||||
@@ -784,7 +784,7 @@ const teardown = (preservePlatformFileSelection = false) => {
|
||||
activeUploadTask?.abort();
|
||||
activeUploadTask = null;
|
||||
speechPlayback.stop();
|
||||
composerRef.value?.teardown();
|
||||
if (!preservePlatformFileSelection) composerRef.value?.teardown();
|
||||
organizing.value = false;
|
||||
uploading.value = false;
|
||||
submitting.value = false;
|
||||
@@ -838,7 +838,7 @@ onShow(() => {
|
||||
}
|
||||
});
|
||||
|
||||
onHide(() => teardown(isPlatformFileSelectionActive()));
|
||||
onHide(() => teardown(isPlatformNativeActivityActive()));
|
||||
onUnload(() => {
|
||||
teardown();
|
||||
speechPlayback.destroy();
|
||||
|
||||
@@ -424,7 +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 { isPlatformNativeActivityActive } from '@/services/file-selection-lifecycle';
|
||||
import type {
|
||||
AnswerFeedbackVerdict,
|
||||
BroadcastKnowledgeContext,
|
||||
@@ -1565,8 +1565,10 @@ onHide(() => {
|
||||
candidateRefreshGeneration += 1;
|
||||
cancelPendingBroadcastConsultation();
|
||||
speechPlayback.stop();
|
||||
composerRef.value?.teardown();
|
||||
if (!isPlatformFileSelectionActive()) cancelVoiceTranscription();
|
||||
if (!isPlatformNativeActivityActive()) {
|
||||
composerRef.value?.teardown();
|
||||
cancelVoiceTranscription();
|
||||
}
|
||||
cancelPendingMediaSearch();
|
||||
});
|
||||
|
||||
|
||||
@@ -219,6 +219,7 @@ import { ensureEmployeePosition } from '@/services/position';
|
||||
import { createPageRequestScope, currentAccountKey } from '@/services/request-scope';
|
||||
import { getBroadcastUnreadCount } from '@/services/broadcast';
|
||||
import { isFileSelectionCancelled } from '@/utils/file-selection';
|
||||
import { isPlatformNativeActivityActive } from '@/services/file-selection-lifecycle';
|
||||
|
||||
const home = ref<RoleHome | null>(null);
|
||||
const assignments = ref<PracticeAssignment[]>([]);
|
||||
@@ -578,8 +579,10 @@ onShow(() => {
|
||||
});
|
||||
|
||||
onHide(() => {
|
||||
holdGeneration += 1;
|
||||
cancelHold();
|
||||
if (!isPlatformNativeActivityActive()) {
|
||||
holdGeneration += 1;
|
||||
cancelHold();
|
||||
}
|
||||
requests.invalidate();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user