async componentDidMount()

in src/myChannels.js [31:54]


  async componentDidMount() {
    try {
      Auth.currentAuthenticatedUser().then((user) => {
        console.log(user.attributes.sub);
        let filter = {
          owner: {
            eq: user.username
          }
        };
        API.graphql({ query: queries.listChannels, variables: { filter: filter } }).then((reply) => {
          this.setState({
            channel_list: reply.data.listChannels.items,
            authid: user.attributes.sub
          })
          console.log(this.state.channel_list);
        });

      })
    }
    catch (e) {
      console.log("ERROR!!!");
      console.log(e);
    }
  }