question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Proof of existence tutorial front end template file upload section not appearing

See original GitHub issue

Steps

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
MehranMazharcommented, Jun 5, 2022
1reaction
omadoyeabrahamcommented, Feb 17, 2022

@MehranMazhar I had the same issue you highlighted above, here’s how I fixed it:

  1. The “api” should be gotten from the “useSubstrateState()” hook instead of the “useSubstrate()” hook. The tutorial has most likely not been updated to reflect changes to the substrate front-end template.

i.e change

const { api } = useSubstrate()

to

const { api } = useSubstrateState()

at the beginning on the Main and TemplateModule functions in the file.

  1. Update the return statement from the TemplateModule function to
 return api.query && api.query.templateModule && api.query.templateModule.proofs ? (
    <Main {...props} />
  ) : null

i.e. add api.query && ........ to handle the initial load when api is undefined.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Upload Files With Django
In this tutorial you will learn the concepts behind Django file upload and how to handle file upload using model forms. In the...
Read more >
Angular File Upload - typescript - Stack Overflow
Here is a working example for file upload to api: Step 1: HTML Template (file-upload.component.html). Define simple input tag of type file ....
Read more >
How to Fix the 'Preview Could Not Be Loaded' Error - Elementor
If you receive the error message “the preview could not be loaded”, try the following: · Enable Safe Mode. · Make sure the...
Read more >
9 How to Upload and Download Files in an Application
This tutorial illustrates how to create a form and report with links for file upload and download, how to create and populate a...
Read more >
A Detailed Guide To A Custom WordPress Page Templates
At the bottom of the hierarchy is index.php. It will be used to display any content which does not have a more specific...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found