Skip to content

Commit fbbef34

Browse files
Show the code dialog every time we are asked for a code
1 parent 0d1ef14 commit fbbef34

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

android/app/src/main/java/com/marshallofsound/gpmdp/remote/device/DeviceModule.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package com.marshallofsound.gpmdp.remote.device;
22

3+
import android.content.DialogInterface;
34
import android.content.res.Configuration;
45
import android.support.annotation.Nullable;
56
import android.text.InputType;
@@ -66,9 +67,15 @@ public void dialog(String title, String content, String positiveText, final Prom
6667
.input("", null, false, new MaterialDialog.InputCallback() {
6768
@Override
6869
public void onInput(MaterialDialog dialog, CharSequence input) {
69-
promise.resolve(input.toString());
70+
promise.resolve(input.toString());
7071
}
7172
})
73+
.cancelListener(new DialogInterface.OnCancelListener() {
74+
@Override
75+
public void onCancel(DialogInterface dialogInterface) {
76+
promise.reject("", "");
77+
}
78+
})
7279
.show();
7380
}
7481
}

src/stores/WebSocketStore.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,10 @@ export default class WebSocketStore {
121121
}
122122
userInputPromise.then((val) => {
123123
this._sendMessage({ namespace: 'connect', method: 'connect', arguments: ['_', val] })
124+
this.awaitingCode = false
125+
})
126+
.catch(() => {
127+
this.awaitingCode = false
124128
})
125129
} else {
126130
AsyncStorage.setItem('AUTH_CODE', payload)

0 commit comments

Comments
 (0)