mirror of
https://github.com/fazo96/ipfs-boards
synced 2025-03-11 21:38:38 +01:00
bugfixing
This commit is contained in:
parent
3f5824b497
commit
58af5f5e71
@ -168,7 +168,7 @@ BoardsAPI.prototype.createBoard = function (board, done) {
|
||||
|
||||
BoardsAPI.prototype.createPost = function (post, board, done) {
|
||||
try {
|
||||
post.date = (new Date()).getTime()
|
||||
post.date = parseInt((new Date()).getTime() / 1000, 10)
|
||||
post.op = this.id
|
||||
var post_str = JSON.stringify(post)
|
||||
} catch (e) {
|
||||
|
@ -18,7 +18,7 @@ module.exports = React.createClass({
|
||||
init (boards, props) {
|
||||
var onPost = (hash, date, post) => {
|
||||
if (!this.isMounted()) return true
|
||||
var now = (new Date()).getTime()
|
||||
var now = parseInt((new Date()).getTime() / 1000, 10)
|
||||
var posts = this.state.posts
|
||||
if (date === undefined || date <= 0) {
|
||||
posts.push(hash)
|
||||
|
@ -52,9 +52,11 @@ module.exports = function (boardsAPI) {
|
||||
save () {
|
||||
this.setState({ updating: true })
|
||||
var post = {
|
||||
title: this.state.title,
|
||||
text: this.state.text
|
||||
}
|
||||
if (this.state.title && this.state.title.length > 0) {
|
||||
post.title = this.state.title
|
||||
}
|
||||
boardsAPI.use(boards => {
|
||||
boards.createPost(post, this.props.params.boardname, err => {
|
||||
this.setState({ error: err, updating: false })
|
||||
|
@ -92,6 +92,11 @@ a:hover {
|
||||
margin: 2rem;
|
||||
}
|
||||
|
||||
.post .content img {
|
||||
margin: auto;
|
||||
max-width: 60rem;
|
||||
}
|
||||
|
||||
.icons .fa, .comment .icons .fa {
|
||||
color: #707070;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user