Skip to content

Commit d2fbdc1

Browse files
authored
Merge branch 'develop' into fix.commonmark-parser-code-block
2 parents ac9dce3 + 06b8910 commit d2fbdc1

File tree

145 files changed

+21672
-10080
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

145 files changed

+21672
-10080
lines changed

.circleci/config.yml

+25-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ orbs:
66

77
macos: &macos
88
macos:
9-
xcode: "14.2.0"
9+
xcode: "15.2.0"
1010
resource_class: macos.m1.medium.gen1
1111

1212
bash-env: &bash-env
@@ -54,7 +54,6 @@ save-gems-cache: &save-gems-cache
5454
update-fastlane-ios: &update-fastlane-ios
5555
name: Update Fastlane
5656
command: |
57-
echo "ruby-2.7.7" > ~/.ruby-version
5857
bundle install
5958
working_directory: ios
6059

@@ -78,6 +77,27 @@ restore_cache: &restore-gradle-cache
7877
# COMMANDS
7978
commands:
8079

80+
manage-ruby:
81+
description: "Manage ruby version"
82+
steps:
83+
- restore_cache:
84+
name: Restore ruby
85+
key: ruby-v2-{{ checksum ".ruby-version" }}
86+
- run:
87+
name: Install ruby
88+
command: |
89+
echo "ruby-2.7.7" > ~/.ruby-version
90+
if [ -d ~/.rbenv/versions/2.7.7 ]; then
91+
echo "Ruby already installed"
92+
else
93+
rbenv install 2.7.7
94+
fi
95+
- save_cache:
96+
name: Save ruby cache
97+
key: ruby-v2-{{ checksum ".ruby-version" }}
98+
paths:
99+
- ~/.rbenv/versions/2.7.7
100+
81101
manage-pods:
82102
description: "Restore/Get/Save cache of pods libs"
83103
steps:
@@ -204,6 +224,7 @@ commands:
204224
- checkout
205225
- restore_cache: *restore-gems-cache
206226
- restore_cache: *restore-npm-cache-mac
227+
- manage-ruby
207228
- run: *install-npm-modules
208229
- run: *update-fastlane-ios
209230
- manage-pods
@@ -328,6 +349,7 @@ commands:
328349
at: ios
329350
- restore_cache: *restore-gems-cache
330351
- restore_cache: *restore-npm-cache-mac
352+
- manage-ruby
331353
- run: *install-npm-modules
332354
- run: *update-fastlane-ios
333355
- manage-pods
@@ -575,6 +597,7 @@ jobs:
575597
- checkout
576598
- restore_cache: *restore-gems-cache
577599
- restore_cache: *restore-npm-cache-mac
600+
- manage-ruby
578601
- run: *install-npm-modules
579602
- run: *update-fastlane-ios
580603
- save_cache: *save-npm-cache-mac
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: organize translations
2+
3+
on:
4+
push:
5+
paths:
6+
- 'app/i18n/locales/**.json'
7+
8+
jobs:
9+
organize-and-commit:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
with:
14+
fetch-depth: 0
15+
16+
- name: Setup Node.js
17+
uses: actions/setup-node@v4
18+
with:
19+
node-version: 18
20+
21+
- name: Run script to organize JSON keys
22+
run: node scripts/organize-translations.js
23+
24+
- name: Get changed files
25+
id: git-check
26+
uses: tj-actions/changed-files@v42
27+
with:
28+
files: |
29+
**.json
30+
31+
- name: List all changed files
32+
if: steps.git-check.outputs.any_changed == 'true'
33+
env:
34+
ALL_CHANGED_FILES: ${{ steps.git-check.outputs.all_changed_files }}
35+
run: |
36+
for file in ${ALL_CHANGED_FILES}; do
37+
echo "$file was changed"
38+
done
39+
40+
- name: Commit and push if changes
41+
if: steps.git-check.outputs.any_changed == 'true'
42+
uses: EndBug/add-and-commit@v9
43+
with:
44+
message: 'action: organized translations'

__tests__/containers/RoomItem/__snapshots__/RoomItem.stories.storyshot

+3-3
Large diffs are not rendered by default.

__tests__/containers/markdown/new/__snapshots__/NewMarkdown.stories.storyshot

+1-1
Large diffs are not rendered by default.

__tests__/containers/message/__snapshots__/Message.stories.storyshot

+38-38
Large diffs are not rendered by default.

__tests__/views/RoomView/LoadMore/__snapshots__/LoadMore.stories.storyshot

+3-3
Large diffs are not rendered by default.

app/containers/AudioPlayer/index.tsx

+24-16
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ import styles from './styles';
1010
import Seek from './Seek';
1111
import PlaybackSpeed from './PlaybackSpeed';
1212
import PlayButton from './PlayButton';
13-
import EventEmitter from '../../lib/methods/helpers/events';
14-
import audioPlayer, { AUDIO_FOCUSED } from '../../lib/methods/audioPlayer';
13+
import AudioManager from '../../lib/methods/AudioManager';
1514
import { AUDIO_PLAYBACK_SPEED, AVAILABLE_SPEEDS } from './constants';
1615
import { TDownloadState } from '../../lib/methods/handleMediaDownload';
16+
import { emitter } from '../../lib/methods/helpers';
1717
import { TAudioState } from './types';
1818
import { useUserPreferences } from '../../lib/methods';
1919

@@ -86,23 +86,23 @@ const AudioPlayer = ({
8686
};
8787

8888
const setPosition = async (time: number) => {
89-
await audioPlayer.setPositionAsync(audioUri.current, time);
89+
await AudioManager.setPositionAsync(audioUri.current, time);
9090
};
9191

9292
const togglePlayPause = async () => {
9393
try {
9494
if (!paused) {
95-
await audioPlayer.pauseAudio(audioUri.current);
95+
await AudioManager.pauseAudio();
9696
} else {
97-
await audioPlayer.playAudio(audioUri.current);
97+
await AudioManager.playAudio(audioUri.current);
9898
}
9999
} catch {
100100
// Do nothing
101101
}
102102
};
103103

104104
useEffect(() => {
105-
audioPlayer.setRateAsync(audioUri.current, playbackSpeed);
105+
AudioManager.setRateAsync(audioUri.current, playbackSpeed);
106106
}, [playbackSpeed]);
107107

108108
const onPress = () => {
@@ -116,11 +116,13 @@ const AudioPlayer = ({
116116
};
117117

118118
useEffect(() => {
119-
InteractionManager.runAfterInteractions(async () => {
120-
audioUri.current = await audioPlayer.loadAudio({ msgId, rid, uri: fileUri });
121-
audioPlayer.setOnPlaybackStatusUpdate(audioUri.current, onPlaybackStatusUpdate);
122-
audioPlayer.setRateAsync(audioUri.current, playbackSpeed);
123-
});
119+
if (fileUri) {
120+
InteractionManager.runAfterInteractions(async () => {
121+
audioUri.current = await AudioManager.loadAudio({ msgId, rid, uri: fileUri });
122+
AudioManager.setOnPlaybackStatusUpdate(audioUri.current, onPlaybackStatusUpdate);
123+
AudioManager.setRateAsync(audioUri.current, playbackSpeed);
124+
});
125+
}
124126
}, [fileUri]);
125127

126128
useEffect(() => {
@@ -133,20 +135,26 @@ const AudioPlayer = ({
133135

134136
useEffect(() => {
135137
const unsubscribeFocus = navigation.addListener('focus', () => {
136-
audioPlayer.setOnPlaybackStatusUpdate(audioUri.current, onPlaybackStatusUpdate);
138+
AudioManager.setOnPlaybackStatusUpdate(audioUri.current, onPlaybackStatusUpdate);
139+
AudioManager.addAudioRendered(audioUri.current);
140+
});
141+
const unsubscribeBlur = navigation.addListener('blur', () => {
142+
AudioManager.removeAudioRendered(audioUri.current);
137143
});
138144

139145
return () => {
140146
unsubscribeFocus();
147+
unsubscribeBlur();
141148
};
142149
}, [navigation]);
143150

144151
useEffect(() => {
145-
const listener = EventEmitter.addEventListener(AUDIO_FOCUSED, ({ audioFocused }: { audioFocused: string }) => {
146-
setFocused(audioFocused === audioUri.current);
147-
});
152+
const audioFocusedEventHandler = (audioFocused: string) => {
153+
setFocused(!!audioFocused && audioFocused === audioUri.current);
154+
};
155+
emitter.on('audioFocused', audioFocusedEventHandler);
148156
return () => {
149-
EventEmitter.removeListener(AUDIO_FOCUSED, listener);
157+
emitter.off('audioFocused', audioFocusedEventHandler);
150158
};
151159
}, []);
152160

0 commit comments

Comments
 (0)