Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
fix SoundManagerModule (#6)
Browse files Browse the repository at this point in the history
  • Loading branch information
janisslsm authored Jan 28, 2023
1 parent ff7d605 commit 6330731
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
15 changes: 10 additions & 5 deletions app/src/main/java/com/discord/sounds/SoundManagerModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@
import com.facebook.react.bridge.Callback;
import com.facebook.react.bridge.ReactApplicationContext;
import com.facebook.react.bridge.ReactMethod;
import kotlin.jvm.internal.r;

public final class SoundManagerModule extends ReactContextBaseJavaModule {
private final SoundManager soundManager;

public SoundManagerModule(ReactApplicationContext reactApplicationContext0) {
super(reactApplicationContext0);
r.g(reactApplicationContext0, "reactContext");
if(reactApplicationContext0 == null)
throw new NullPointerException("reactApplicationContext must not be null");
this.soundManager = new SoundManager(reactApplicationContext0);
}

Expand All @@ -37,8 +37,11 @@ public final void play(int v) {

@ReactMethod
public final void prepare(String s, String s1, int v, Callback callback0) {
r.g(s, "fileName");
r.g(callback0, "callback");
if(s == null)
throw new NullPointerException("s must not be null");
if(callback0 == null)
throw new NullPointerException("callback0 must not be null");

Log.i$default(Log.INSTANCE, "SoundManager", "Prepare " + s + " with " + v + ".", null, 4, null);
int v1 = 5;
if(s1 != null) {
Expand All @@ -63,7 +66,9 @@ else if(s1.equals("voice")) {
}

ReactApplicationContext reactApplicationContext0 = this.getReactApplicationContext();
r.f(reactApplicationContext0, "reactApplicationContext");
if(reactApplicationContext0 == null)
throw new NullPointerException("reactApplicationContext must not be null");

int v3 = SoundManagerModule.resolveRawResId$default(this, reactApplicationContext0, s, null, 2, null);
com.discord.sounds.SoundManagerModule$prepare$1 soundManagerModule$prepare$10 = new com.discord.sounds.SoundManagerModule$prepare$1(callback0);
this.soundManager.prepare(v, v1, v3, soundManagerModule$prepare$10);
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ android.useAndroidX=true
# Automatically convert third-party libraries to use AndroidX
android.enableJetifier=true

discord_version=132205
discord_version=164203

0 comments on commit 6330731

Please sign in to comment.