message: fix(origin-ui): fix watching for return to inbox event
diff: @@ -133,9 +133,7 @@ function* initEventHandler() {
  });
  });
  - certificateContractEventHandler.onEvent('LogCertificateSplit', async function(
  - event: any
  - ) {
  + marketContractEventHandler.onEvent('LogUnpublishForSale', async function(event: any) {
  const id = event.returnValues._certificateId?.toString();
  if (typeof id !== 'string') {
  @@ -152,7 +150,35 @@ function* initEventHandler() {
  });
  });
  - certificateContractEventHandler.onEvent('LogCertificateClaimed', async function(
  + marketContractEventHandler.onEvent('createdNewDemand', async (event: any) => {
  + try {
  + const demand = await new Demand.Entity(
  + event.returnValues._demandId.toString(),
  + configuration
  + ).sync();
  +
  + emitter({
  + action: demandCreated(demand)
  + });
  + } catch (error) {
  + console.error(`Error while handling "createdNewDemand" event`, error);
  + }
  + });
  +
  + marketContractEventHandler.onEvent('DemandStatusChanged', async (event: any) => {
  + if (event.returnValues._status === Demand.DemandStatus.ARCHIVED) {
  + emitter({
  + action: demandDeleted(
  + await new Demand.Entity(
  + event.returnValues._demandId.toString(),
  + configuration
  + ).sync()
  + )
  + });
  + }
  + });
  +
  + certificateContractEventHandler.onEvent('LogCertificateSplit', async function(
  event: any
  ) {
  const id = event.returnValues._certificateId?.toString();
  @@ -171,8 +197,10 @@ function* initEventHandler() {
  });
  });
  - certificateContractEventHandler.onEvent('Transfer', async function(event: any) {
  - const id = event.returnValues.tokenId?.toString();
  + certificateContractEventHandler.onEvent('LogCertificateClaimed', async function(
  + event: any
  + ) {
  + const id = event.returnValues._certificateId?.toString();
  if (typeof id !== 'string') {
  return;
  @@ -188,10 +216,8 @@ function* initEventHandler() {
  });
  });
  - certificateContractEventHandler.onEvent('LogUnpublishForSale', async function(
  - event: any
  - ) {
  - const id = event.returnValues._certificateId?.toString();
  + certificateContractEventHandler.onEvent('Transfer', async function(event: any) {
  + const id = event.returnValues.tokenId?.toString();
  if (typeof id !== 'string') {
  return;
  @@ -207,34 +233,6 @@ function* initEventHandler() {
  });
  });
  - marketContractEventHandler.onEvent('createdNewDemand', async (event: any) => {
  - try {
  - const demand = await new Demand.Entity(
  - event.returnValues._demandId.toString(),
  - configuration
  - ).sync();
  -
  - emitter({
  - action: demandCreated(demand)
  - });
  - } catch (error) {
  - console.error(`Error while handling "createdNewDemand" event`, error);
  - }
  - });
  -
  - marketContractEventHandler.onEvent('DemandStatusChanged', async (event: any) => {
  - if (event.returnValues._status === Demand.DemandStatus.ARCHIVED) {
  - emitter({
  - action: demandDeleted(
  - await new Demand.Entity(
  - event.returnValues._demandId.toString(),
  - configuration
  - ).sync()
  - )
  - });
  - }
  - });
  -
  return () => {
  eventHandlerManager.stop();
  };
  