1
0
mirror of https://github.com/axllent/mailpit.git synced 2025-06-15 00:05:15 +02:00

UI: Refresh search results when search resubmitted or active tag filter clicked

This commit is contained in:
Ralph Slooten
2023-12-31 09:22:33 +13:00
parent 0f0717786e
commit 4568b95bd6
3 changed files with 31 additions and 6 deletions

View File

@ -5,10 +5,11 @@ import { pagination } from '../stores/pagination'
export default {
mixins: [CommonMixins],
emits: ['loadMessages'],
data() {
return {
search: '',
pagination
search: ''
}
},
@ -33,6 +34,12 @@ export default {
if (this.search == '') {
this.$router.push('/')
} else {
const urlParams = new URLSearchParams(window.location.search)
let curr = urlParams.get('q')
if (curr && curr == this.search) {
pagination.start = 0
this.$emit('loadMessages')
}
this.$router.push('/search?q=' + encodeURIComponent(this.search))
}