Fix upload attempt to undefined

This commit is contained in:
Kevin Froman 2020-11-09 00:09:00 +00:00
parent 373c4ce83f
commit c81f017cde
2 changed files with 9 additions and 2 deletions

View File

@ -36,7 +36,7 @@
<a href="LICENSE.txt"><img src="copyleft.png" alt="GNU" loading="lazy" class="is-pulled-right"></a>
</p>
<noscript><p class="has-text-warning">
JavaScript is required for this app. The server has no knowledge of posts, so content must be served by P2P nodes.
javascript is required for this app. The server has no knowledge of posts, so content must be served by P2P nodes.
</p></noscript>
<p>lycan is a message board program that utilizes the <a href="https://onionr.net/">Onionr</a> network.</p>
<p>posts are rate-limited and protected using a partial hash collision proof of work function.</p>
@ -77,7 +77,7 @@
<div class="column is-two-fifths">
<div class="postForm">
<div class="control">
<p>Markdown and limited HTML is supported.</p>
<p>markdown and limited HTML is supported.</p>
<textarea class="textarea" placeholder="Draft a post..." id="postMessageField"></textarea>
</div>
</div>

View File

@ -48,6 +48,13 @@ async function doUpload(data){
}, 1000)
return
}
const curNode = getCurrentNode()
if (typeof curNode == "undefined"){
setTimeout(function(){
doUpload(data)
}, 1000)
return
}
let decoder = new TextDecoder("utf-8")
let uploadTimeout = setTimeout(function(){