1
0
mirror of https://github.com/fazo96/ipfs-boards synced 2025-03-12 21:48:39 +01:00

bugfixing

This commit is contained in:
Enrico Fasoli 2015-12-21 16:27:08 +01:00
parent 3f5824b497
commit 58af5f5e71
4 changed files with 10 additions and 3 deletions

View File

@ -168,7 +168,7 @@ BoardsAPI.prototype.createBoard = function (board, done) {
BoardsAPI.prototype.createPost = function (post, board, done) { BoardsAPI.prototype.createPost = function (post, board, done) {
try { try {
post.date = (new Date()).getTime() post.date = parseInt((new Date()).getTime() / 1000, 10)
post.op = this.id post.op = this.id
var post_str = JSON.stringify(post) var post_str = JSON.stringify(post)
} catch (e) { } catch (e) {

View File

@ -18,7 +18,7 @@ module.exports = React.createClass({
init (boards, props) { init (boards, props) {
var onPost = (hash, date, post) => { var onPost = (hash, date, post) => {
if (!this.isMounted()) return true if (!this.isMounted()) return true
var now = (new Date()).getTime() var now = parseInt((new Date()).getTime() / 1000, 10)
var posts = this.state.posts var posts = this.state.posts
if (date === undefined || date <= 0) { if (date === undefined || date <= 0) {
posts.push(hash) posts.push(hash)

View File

@ -52,9 +52,11 @@ module.exports = function (boardsAPI) {
save () { save () {
this.setState({ updating: true }) this.setState({ updating: true })
var post = { var post = {
title: this.state.title,
text: this.state.text text: this.state.text
} }
if (this.state.title && this.state.title.length > 0) {
post.title = this.state.title
}
boardsAPI.use(boards => { boardsAPI.use(boards => {
boards.createPost(post, this.props.params.boardname, err => { boards.createPost(post, this.props.params.boardname, err => {
this.setState({ error: err, updating: false }) this.setState({ error: err, updating: false })

View File

@ -92,6 +92,11 @@ a:hover {
margin: 2rem; margin: 2rem;
} }
.post .content img {
margin: auto;
max-width: 60rem;
}
.icons .fa, .comment .icons .fa { .icons .fa, .comment .icons .fa {
color: #707070; color: #707070;
} }