Usability improvements, fix Firefox message hovering.
This commit is contained in:
Troplo 2022-08-31 21:41:59 +10:00
parent 7125909046
commit d6f64de95e
6 changed files with 594 additions and 797 deletions

View file

@ -992,13 +992,24 @@ router.delete("/:id/message/:mId", auth, async (req, res, next) => {
] ]
}) })
if (chat) { if (chat) {
const message = await Message.findOne({ let options
where: { if (chat.rank === "admin") {
id: req.params.mId, options = {
chatId: chat.chat.id, where: {
userId: req.user.id 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) { if (message) {
await message.destroy() await message.destroy()
chat.chat.users.forEach((user) => { chat.chat.users.forEach((user) => {

View file

@ -1,6 +1,6 @@
{ {
"name": "colubrina", "name": "colubrina",
"version": "1.0.26", "version": "1.0.27",
"description": "Simple instant communication.", "description": "Simple instant communication.",
"private": true, "private": true,
"author": "Troplo <troplo@troplo.com>", "author": "Troplo <troplo@troplo.com>",

View file

@ -753,6 +753,8 @@ export default {
} }
}, },
async mounted() { async mounted() {
if (localStorage.getItem("forceEnableDevMode"))
this.$store.state.release = "dev"
await this.$store.dispatch("doInit") await this.$store.dispatch("doInit")
if (this.$vuetify.breakpoint.mobile) { if (this.$vuetify.breakpoint.mobile) {
this.$store.state.drawer = false this.$store.state.drawer = false

View file

@ -15,6 +15,7 @@
right: 0; right: 0;
margin-top: -15px; margin-top: -15px;
margin-right: 5px; margin-right: 5px;
visibility: hidden;
} }
/* large codeblock */ /* large codeblock */
code { code {
@ -23,13 +24,25 @@ code {
display: block; display: block;
padding: 20px; padding: 20px;
} }
.message-hover { .message:hover {
background-color: var(--v-bg-lighten1); background-color: var(--v-bg-lighten1);
border-radius: 5px; border-radius: 5px;
} }
.message-toast { .message-toast {
background-color: rgba(47, 47, 47, 0.9) !important; 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 { img.emoji {
/* Since we are using SVGs, you have to change the width using CSS */ /* Since we are using SVGs, you have to change the width using CSS */
height: 1.4em; height: 1.4em;

View file

@ -601,9 +601,27 @@
</v-tooltip> </v-tooltip>
</template> </template>
<template v-else> <template v-else>
<v-toolbar-title> <v-toolbar-title
{{ $route.name }} v-if="!$vuetify.breakpoint.mobile"
</v-toolbar-title> id="bettercompass-title"
:style="
'color: ' +
$vuetify.theme.themes[$vuetify.theme.dark ? 'dark' : 'light']
.primary
"
class="troplo-title"
@click="$router.push('/')"
style="cursor: pointer"
>{{ $store.state.site.name }}</v-toolbar-title
><v-app-bar-nav-icon
v-if="
!$vuetify.breakpoint.mobile &&
$store.state.site.release !== 'stable'
"
style="z-index: 1000"
disabled
>{{ $store.state.site.release }}</v-app-bar-nav-icon
>
<v-spacer></v-spacer> <v-spacer></v-spacer>
<v-tooltip bottom> <v-tooltip bottom>
<template v-slot:activator="{ on }"> <template v-slot:activator="{ on }">
@ -954,6 +972,12 @@ export default {
}, },
methods: { methods: {
goToRoute() { goToRoute() {
if (this.route.value === "forceEnableDevMode") {
this.$store.state.site.release = "dev"
localStorage.setItem("forceEnableDevMode", "true")
this.$toast.success("OK")
return
}
this.$router.push(this.route.value) this.$router.push(this.route.value)
this.route.modal = false this.route.modal = false
this.route.value = "" this.route.value = ""

File diff suppressed because it is too large Load diff