diff --git a/app/views/RoomView/index.tsx b/app/views/RoomView/index.tsx index 5a8c13cc1..58c84d04e 100644 --- a/app/views/RoomView/index.tsx +++ b/app/views/RoomView/index.tsx @@ -102,7 +102,7 @@ import { import { Services } from '../../lib/services'; import { withActionSheet, IActionSheetProvider } from '../../containers/ActionSheet'; import { goRoom, TGoRoomItem } from '../../lib/methods/helpers/goRoom'; -import handleAudioMedia from '../../lib/methods/handleAudioMedia'; +import audioPlayer from '../../lib/methods/audioPlayer'; type TStateAttrsUpdate = keyof IRoomViewState; @@ -429,7 +429,8 @@ class RoomView extends React.Component { const { editing, room } = this.state; const db = database.active; this.mounted = false; - await handleAudioMedia.unloadAllAudios(); + // TODO: Refactor when audio becomes global + await audioPlayer.pauseCurrentAudio(); if (!editing && this.messagebox && this.messagebox.current) { const { text } = this.messagebox.current; let obj: TSubscriptionModel | TThreadModel | null = null; diff --git a/app/views/RoomsListView/index.tsx b/app/views/RoomsListView/index.tsx index 2443da243..9bd064780 100644 --- a/app/views/RoomsListView/index.tsx +++ b/app/views/RoomsListView/index.tsx @@ -60,6 +60,7 @@ import { } from '../../lib/methods/helpers'; import { E2E_BANNER_TYPE, DisplayMode, SortBy, MAX_SIDEBAR_WIDTH, themes } from '../../lib/constants'; import { Services } from '../../lib/services'; +import audioPlayer from '../../lib/methods/audioPlayer'; type TNavigation = CompositeNavigationProp< StackNavigationProp, @@ -228,6 +229,8 @@ class RoomsListView extends React.Component { this.animated = false;