Building the session setters

The session setters have a standard format, as follows:

BuyerSessionView = () => {
this.setState({
role: 'Buyer',
option: 'View'
})
this.viewLC();
};

On invocation, they set the state role and option, based on their functionality. So, in the preceding example, BuyerSessionView sets the role to Buyer and the option to View.

In the case of all the View setters, the session setter method also calls the viewLC() method to populate the LCnew array before rendering the view LC screen. The viewLC() method fetches the list of LCs relevant to the current session user from the LCMaster smart contract and populates it in the LCnew[] array.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.21.233.41