Skip to content

Commit d1a483a

Browse files
committed
refactor: simplify code to open thread editor
1 parent e8c7a1f commit d1a483a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/views/Threads.vue

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@
200200

201201
<div class="board-sidebar">
202202
<div class="board-actions" v-if="loggedIn">
203-
<a v-if="canCreate()" class="button secondary" href="#" @click="loadEditor()">
203+
<a v-if="canCreate()" class="button secondary" href="#" @click.prevent="showEditor = true">
204204
<i class="icon-epoch-add"></i>Start a New Thread
205205
</a>
206206
<a class="button secondary" @click="watchBoard()" v-if="threadData && threadData.data && threadData.data.board">
@@ -292,8 +292,6 @@ export default {
292292
}
293293
294294
/* View Methods */
295-
const loadEditor = () => v.showEditor = true
296-
297295
const watchBoard = () => {
298296
if (v.threadData.data.board.watched) {
299297
watchlistApi.unwatchBoard(v.threadData.data.board.id)
@@ -392,7 +390,7 @@ export default {
392390
v.banned = BanStore.updateBanNotice(v.threadData.data.banned_from_board)
393391
})) // Update threads on login
394392
395-
return { ...toRefs(v), canCreate, canSetModerator, loadEditor, watchBoard, setSortField, getSortClass, humanDate, decode, truncate }
393+
return { ...toRefs(v), createThread, canCreate, canSetModerator, watchBoard, setSortField, getSortClass, humanDate, decode, truncate }
396394
}
397395
}
398396
</script>

0 commit comments

Comments
 (0)