demo fix
This commit is contained in:
13
App.tsx
13
App.tsx
@@ -67,6 +67,12 @@ export default class App extends Component<AppProps, WalletmanAppState> {
|
|||||||
async componentDidMount() {
|
async componentDidMount() {
|
||||||
await this.setupPermissions();
|
await this.setupPermissions();
|
||||||
|
|
||||||
|
this.echoSub = onProxyMessage((msg) => {
|
||||||
|
if (msg.type === 'echo') {
|
||||||
|
Alert.alert('Echo 回来了', JSON.stringify(msg.data));
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Login with auto-retry every 3s until success (setTimeout, non-blocking)
|
// Login with auto-retry every 3s until success (setTimeout, non-blocking)
|
||||||
const doLogin = () => {
|
const doLogin = () => {
|
||||||
Api.instance.login('test123', '123456')
|
Api.instance.login('test123', '123456')
|
||||||
@@ -93,13 +99,6 @@ export default class App extends Component<AppProps, WalletmanAppState> {
|
|||||||
|
|
||||||
sendEcho = () => {
|
sendEcho = () => {
|
||||||
const text = `hello_${Date.now()}`;
|
const text = `hello_${Date.now()}`;
|
||||||
this.echoSub?.remove();
|
|
||||||
this.echoSub = onProxyMessage((msg) => {
|
|
||||||
if (msg.type === 'echo') {
|
|
||||||
Alert.alert('Echo 回来了', JSON.stringify(msg.data));
|
|
||||||
this.echoSub?.remove();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
proxySendMessage({ type: 'echo', messageId: `echo_${Date.now()}`, data: { text } });
|
proxySendMessage({ type: 'echo', messageId: `echo_${Date.now()}`, data: { text } });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Submodule libs/rnwalletman updated: 44b5308b9d...a952e657ff
Reference in New Issue
Block a user