I would like to enable sharing of certain pages of textlibrary to the public.
Using the multistorage usecase works fine as long as the visiting user is logged in to Blockstack.
Though if a user is not logged in, I get these errors:
Uncaught TypeError: Cannot read property 'hubUrl' of null
What do I need to change (maybe in the code below) so that the data would be accessible to the public?
As always… sorry for these newbie questions… any help is really appreciated.
For the React app I am currently using this code:
fetchData() {
this.setState({ isLoading: true })
//hardcoded username -> just for this example//
const username = "digitalwaveriding.id"
const options = { username: username, decrypt: false, zoneFileLookupURL: 'https://core.blockstack.org/v1/names/' }
getFile(textsFileName, options)
.then((file) => {
var arrTexts = JSON.parse(file || '[]');
this.setState({
arrTexts: arrTexts,
})
})
.finally(() => {
this.setState({ isLoading: false })
})
};