Skip to content

Commit

Permalink
Store get_info and create_order response in store and display on LSPS…
Browse files Browse the repository at this point in the history
…1 view
  • Loading branch information
shubhamkmr04 committed Apr 10, 2024
1 parent 9203024 commit f6a65ce
Show file tree
Hide file tree
Showing 2 changed files with 336 additions and 185 deletions.
12 changes: 7 additions & 5 deletions stores/LSPStore.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { action, observable } from 'mobx';
import ReactNativeBlobUtil from 'react-native-blob-util';
import EncryptedStorage from 'react-native-encrypted-storage';

import SettingsStore from './SettingsStore';
import ChannelsStore from './ChannelsStore';
Expand All @@ -23,6 +22,8 @@ export default class LSPStore {
@observable public showLspSettings: boolean = false;
@observable public channelAcceptor: any;
@observable public customMessagesSubscriber: any;
@observable public getInfoData: any = {};
@observable public createOrderResponse: any = {};

settingsStore: SettingsStore;
channelsStore: ChannelsStore;
Expand Down Expand Up @@ -319,10 +320,11 @@ export default class LSPStore {
console.log('peer', peer);
console.log('data', data);

await EncryptedStorage.setItem(
'get_info_data',
JSON.stringify(data)
);
if (data.id === '42') {
this.getInfoData = data;
} else {
this.createOrderResponse = data;
}
} catch (error: any) {
console.error(
'sub custom messages error: ' + error.message
Expand Down
Loading

0 comments on commit f6a65ce

Please sign in to comment.