Skip to content

Commit

Permalink
change default mode to "both" when clicking edit
Browse files Browse the repository at this point in the history
Add "both" mode to URLs because I assume most people want to straight away see the code when they click the "edit" button in a published note.

Fixes hedgedoc#27

Not tested, followed instructions from @ccoenen , please do review! :)
  • Loading branch information
stragu committed Apr 5, 2019
1 parent fdd912d commit 52acaa9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/response.js
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ function publishNoteActions (req, res, next) {
actionDownload(req, res, note)
break
case 'edit':
res.redirect(config.serverURL + '/' + (note.alias ? note.alias : models.Note.encodeNoteId(note.id)))
res.redirect(config.serverURL + '/' + (note.alias ? note.alias : models.Note.encodeNoteId(note.id)) + '?both')
break
default:
res.redirect(config.serverURL + '/s/' + note.shortid)
Expand All @@ -441,7 +441,7 @@ function publishSlideActions (req, res, next) {
var action = req.params.action
switch (action) {
case 'edit':
res.redirect(config.serverURL + '/' + (note.alias ? note.alias : models.Note.encodeNoteId(note.id)))
res.redirect(config.serverURL + '/' + (note.alias ? note.alias : models.Note.encodeNoteId(note.id)) + '?both')
break
default:
res.redirect(config.serverURL + '/p/' + note.shortid)
Expand Down

0 comments on commit 52acaa9

Please sign in to comment.