From d6f64de95ec4599ded407ef263cf9e8d68a79bd2 Mon Sep 17 00:00:00 2001 From: Troplo Date: Wed, 31 Aug 2022 21:41:59 +1000 Subject: [PATCH] 1.0.27 Usability improvements, fix Firefox message hovering. --- backend/routes/communications.js | 23 +- frontend/package.json | 2 +- frontend/src/App.vue | 2 + frontend/src/assets/styles.css | 15 +- frontend/src/components/Header.vue | 30 +- frontend/src/components/Message.vue | 1319 +++++++++++---------------- 6 files changed, 594 insertions(+), 797 deletions(-) diff --git a/backend/routes/communications.js b/backend/routes/communications.js index 3df59c8..e40b8c0 100644 --- a/backend/routes/communications.js +++ b/backend/routes/communications.js @@ -992,13 +992,24 @@ router.delete("/:id/message/:mId", auth, async (req, res, next) => { ] }) if (chat) { - const message = await Message.findOne({ - where: { - id: req.params.mId, - chatId: chat.chat.id, - userId: req.user.id + let options + if (chat.rank === "admin") { + options = { + where: { + id: req.params.mId, + chatId: chat.chat.id + } } - }) + } else { + options = { + where: { + id: req.params.mId, + chatId: chat.chat.id, + userId: req.user.id + } + } + } + const message = await Message.findOne(options) if (message) { await message.destroy() chat.chat.users.forEach((user) => { diff --git a/frontend/package.json b/frontend/package.json index 1164d3d..4bb8910 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,6 +1,6 @@ { "name": "colubrina", - "version": "1.0.26", + "version": "1.0.27", "description": "Simple instant communication.", "private": true, "author": "Troplo ", diff --git a/frontend/src/App.vue b/frontend/src/App.vue index a9b05ce..938f14f 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -753,6 +753,8 @@ export default { } }, async mounted() { + if (localStorage.getItem("forceEnableDevMode")) + this.$store.state.release = "dev" await this.$store.dispatch("doInit") if (this.$vuetify.breakpoint.mobile) { this.$store.state.drawer = false diff --git a/frontend/src/assets/styles.css b/frontend/src/assets/styles.css index d5cc112..aaafb27 100644 --- a/frontend/src/assets/styles.css +++ b/frontend/src/assets/styles.css @@ -15,6 +15,7 @@ right: 0; margin-top: -15px; margin-right: 5px; + visibility: hidden; } /* large codeblock */ code { @@ -23,13 +24,25 @@ code { display: block; padding: 20px; } -.message-hover { +.message:hover { background-color: var(--v-bg-lighten1); border-radius: 5px; } .message-toast { background-color: rgba(47, 47, 47, 0.9) !important; } +.message-date { + visibility: hidden; +} +.message:hover .message-date { + visibility: visible; +} +.message:hover .message-action-card { + visibility: visible; +} +.message:hover .hide-on-hover { + visibility: hidden; +} img.emoji { /* Since we are using SVGs, you have to change the width using CSS */ height: 1.4em; diff --git a/frontend/src/components/Header.vue b/frontend/src/components/Header.vue index d4db8a1..a8c12a6 100644 --- a/frontend/src/components/Header.vue +++ b/frontend/src/components/Header.vue @@ -601,9 +601,27 @@