mirror of
https://github.com/axllent/mailpit.git
synced 2024-12-30 23:17:59 +02:00
Tidy JS code
This commit is contained in:
parent
4ebbdab7c0
commit
0a13cf8304
@ -6,9 +6,11 @@ import Tinycon from 'tinycon';
|
||||
|
||||
export default {
|
||||
mixins: [commonMixins],
|
||||
|
||||
components: {
|
||||
Message
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
currentPath: window.location.hash,
|
||||
@ -30,9 +32,10 @@ export default {
|
||||
selected: [],
|
||||
tcStatus: 0,
|
||||
appInfo: false,
|
||||
lastLoaded: false,
|
||||
lastLoaded: false
|
||||
}
|
||||
},
|
||||
|
||||
watch: {
|
||||
currentPath(v, old) {
|
||||
if (v && v.match(/^[a-z0-9]+-[a-z0-9]+-[a-z0-9]+-[a-z0-9]+-[a-z0-9]+$/)) {
|
||||
@ -53,6 +56,7 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
canPrev: function () {
|
||||
return this.start > 0;
|
||||
@ -61,6 +65,7 @@ export default {
|
||||
return this.total > (this.start + this.count);
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.currentPath = window.location.hash.slice(1);
|
||||
window.addEventListener('hashchange', () => {
|
||||
@ -80,9 +85,9 @@ export default {
|
||||
this.connect();
|
||||
this.loadMessages();
|
||||
},
|
||||
|
||||
methods: {
|
||||
loadMessages: function () {
|
||||
|
||||
let now = Date.now()
|
||||
// prevent double loading when UI loads & websocket connects
|
||||
if (this.lastLoaded && now - this.lastLoaded < 250) {
|
||||
|
@ -5,4 +5,4 @@ import "./assets/styles.scss";
|
||||
import "../../node_modules/bootstrap-icons/font/bootstrap-icons.scss";
|
||||
import "bootstrap";
|
||||
|
||||
createApp(App).mount('#app')
|
||||
createApp(App).mount('#app');
|
||||
|
@ -12,7 +12,7 @@ FakeModal.prototype.show = function () { alert('open fake modal') }
|
||||
const commonMixins = {
|
||||
data() {
|
||||
return {
|
||||
loading: 0,
|
||||
loading: 0
|
||||
}
|
||||
},
|
||||
|
||||
@ -211,4 +211,4 @@ const commonMixins = {
|
||||
}
|
||||
|
||||
|
||||
export default commonMixins
|
||||
export default commonMixins;
|
||||
|
@ -35,7 +35,6 @@ export default {
|
||||
// force eager callback execution
|
||||
immediate: true
|
||||
}
|
||||
|
||||
},
|
||||
|
||||
mounted() {
|
||||
|
Loading…
Reference in New Issue
Block a user