Skip to content

Commit

Permalink
fixed timestamp and navbar
Browse files Browse the repository at this point in the history
  • Loading branch information
KaranErry committed Apr 17, 2019
1 parent e542504 commit 4af6731
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion routes/chat.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ router.get('/', checkAuthentication, function(req, res, next) {
}
}
).populate('item').sort({ dateChatCreated: -1 }).then(function(doc) {
res.render('chat', { title: 'DrewUse', currentUser: req.session.passport.user._json.email, chats:doc, preselectedThread:preselectedThread});
res.render('chat', { title: 'DrewUse', currentSession: req.session, chats:doc, preselectedThread:preselectedThread});
});
});

Expand Down
2 changes: 1 addition & 1 deletion routes/sellForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ var router = express.Router();
var mongoose= require('mongoose');
var itemData = require('../models/item_model');
var Long = require('mongodb').Long;
var current_millies = new Date().getTime();
// For photo upload and storage
const multer = require('multer');
const cloudinary = require('cloudinary');
Expand Down Expand Up @@ -43,6 +42,7 @@ router.get('/', checkAuthentication, function(req, res, next) {

// post request to create listings
router.post('/insert', imageParser.single('image'), /* this middleware processes the image, adds it to cloudinary, and sends the access parameters in the req object */ (req, res) => {
var current_millies = new Date().getTime();
var current_timestamp = Long.fromNumber(current_millies);
var date = new Date(current_millies);
var dateReadable = date.toString();
Expand Down
6 changes: 3 additions & 3 deletions views/chat.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -193,10 +193,10 @@ img{ max-width:100%;}
<span class="chat_ib">
<input id = "threadId" type="hidden" class="form-control disabled" value="{{this._id}}">
<strong><h5>{{this.item.title}}</h5></strong>
{{#ifEquals this.seller ../currentUser}}
{{#ifEquals this.seller ../currentSession.passport.user._json.email}}
<span class="badge badge-success">Interested Buyer</span>
{{/ifEquals}}
{{#ifEquals this.interestedBuyer ../currentUser}}
{{#ifEquals this.interestedBuyer ../currentSession.passport.user._json.email}}
<span class="badge badge-info">Product Seller</span>
{{/ifEquals}}
<p class="chat_date">Last chatted: </p>
Expand All @@ -207,7 +207,7 @@ img{ max-width:100%;}
</div>
</div>
<div class="mesgs">
<input id = "username" type="hidden" class="form-control disabled" value="{{currentUser}}">
<input id = "username" type="hidden" class="form-control disabled" value="{{currentSession.passport.user._json.email}}">
<div class="msg_history">
<div id="chatroom" class="outgoing_msg">
<div id="feedback" class="sent_msg">
Expand Down

0 comments on commit 4af6731

Please sign in to comment.