Skip to content

Commit be0666f

Browse files
committed
fix unnecessary error messages / linting
1 parent a7dc618 commit be0666f

File tree

3 files changed

+8
-13
lines changed

3 files changed

+8
-13
lines changed

lib/Controller/NotesController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public function index(int $pruneBefore = 0) : JSONResponse {
7979
return $note->getData([ 'content' ]);
8080
}
8181
}, $data['notes']);
82-
if ($lastViewedNote) {
82+
if ($lastViewedNote && !$pruneBefore) {
8383
// check if note exists
8484
try {
8585
$this->notesService->get($userId, $lastViewedNote);

src/App.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,9 @@ export default {
180180
if (availableNotes.length > 0) {
181181
this.routeToNote(availableNotes[0].id)
182182
} else {
183-
this.$router.push({ name: 'welcome' })
183+
if (this.$route.name !== 'welcome') {
184+
this.$router.push({ name: 'welcome' })
185+
}
184186
}
185187
},
186188

src/components/Note.vue

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,12 @@
2020
>
2121
{{ t('notes', 'Details') }}
2222
</ActionButton>
23-
<ActionButton v-if="!preview"
24-
icon="icon-toggle"
25-
v-tooltip.left="t('notes', 'CTRL + /')"
26-
@click="onTogglePreview"
27-
>
28-
{{ t('notes', 'Preview') }}
29-
</ActionButton>
30-
<ActionButton v-else
31-
icon="icon-rename"
23+
<ActionButton
3224
v-tooltip.left="t('notes', 'CTRL + /')"
25+
:icon="preview ? 'icon-rename' : 'icon-toggle'"
3326
@click="onTogglePreview"
3427
>
35-
{{ t('notes', 'Edit') }}
28+
{{ preview ? t('notes', 'Edit') : t('notes', 'Preview') }}
3629
</ActionButton>
3730
<ActionButton
3831
icon="icon-fullscreen"
@@ -317,7 +310,7 @@ export default {
317310
const note = {
318311
...this.note,
319312
}
320-
store.commit('add', note)
313+
store.commit('updateNote', note)
321314
saveNoteManually(this.note.id)
322315
},
323316
},

0 commit comments

Comments
 (0)