diff --git a/pinry-spa/src/components/Boards.vue b/pinry-spa/src/components/Boards.vue index 94f5de5..b8dbeb0 100644 --- a/pinry-spa/src/components/Boards.vue +++ b/pinry-spa/src/components/Boards.vue @@ -21,7 +21,7 @@ >
{ + if (user === null) { + self.editorMeta.user.loggedIn = false; + self.editorMeta.user.meta = {}; + } else { + self.editorMeta.user.meta = user; + self.editorMeta.user.loggedIn = true; + } + }, + ); + }, reset() { const data = initialData(); Object.entries(data).forEach( @@ -128,8 +146,14 @@ export default { ); this.initialize(); }, - shouldShowEdit(boardId) { - return this.currentEditBoard === boardId; + shouldShowEdit(board) { + if (!this.editorMeta.user.loggedIn) { + return false; + } + if (this.editorMeta.user.meta.username !== board.author) { + return false; + } + return this.currentEditBoard === board.id; }, onPinImageLoaded(itemId) { this.blocksMap[itemId].class = { @@ -197,6 +221,7 @@ export default { created() { bus.bus.$on(bus.events.refreshBoards, this.reset); this.registerScrollEvent(); + this.initializeMeta(); this.initialize(); }, };