mirror of
https://github.com/gotson/komga.git
synced 2025-01-09 04:08:00 +08:00
perf(webui): reduce number of API calls on app initial load
This commit is contained in:
parent
5f8894d47a
commit
f7dc98aa7e
@ -473,8 +473,12 @@ export default Vue.extend({
|
||||
this.modal = val
|
||||
},
|
||||
modal(val) {
|
||||
!val && this.dialogCancel()
|
||||
val && this.getThumbnails(this.books)
|
||||
if (val) {
|
||||
this.getThumbnails(this.books)
|
||||
this.loadAvailableTags()
|
||||
} else {
|
||||
this.dialogCancel()
|
||||
}
|
||||
},
|
||||
books: {
|
||||
immediate: true,
|
||||
@ -515,9 +519,6 @@ export default Vue.extend({
|
||||
links: {},
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.tagsAvailable = await this.$komgaReferential.getTags()
|
||||
},
|
||||
computed: {
|
||||
authorRoles(): NameValue[] {
|
||||
let remoteRoles = [] as string[]
|
||||
@ -564,6 +565,9 @@ export default Vue.extend({
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
async loadAvailableTags() {
|
||||
this.tagsAvailable = await this.$komgaReferential.getTags()
|
||||
},
|
||||
linksLabelRules(label: string): boolean | string {
|
||||
if (!!this.$_.trim(label)) return true
|
||||
return this.$t('common.required').toString()
|
||||
|
@ -433,8 +433,13 @@ export default Vue.extend({
|
||||
this.modal = val
|
||||
},
|
||||
modal(val) {
|
||||
!val && this.dialogCancel()
|
||||
val && this.getThumbnails(this.series)
|
||||
if(val) {
|
||||
this.getThumbnails(this.series)
|
||||
this.loadAvailableTags()
|
||||
this.loadAvailableGenres()
|
||||
} else {
|
||||
this.dialogCancel()
|
||||
}
|
||||
},
|
||||
series(val) {
|
||||
this.dialogReset(val)
|
||||
@ -470,10 +475,6 @@ export default Vue.extend({
|
||||
totalBookCount: {minValue: minValue(1)},
|
||||
},
|
||||
},
|
||||
async created() {
|
||||
this.genresAvailable = await this.$komgaReferential.getGenres()
|
||||
this.tagsAvailable = await this.$komgaReferential.getTags()
|
||||
},
|
||||
computed: {
|
||||
single(): boolean {
|
||||
return !Array.isArray(this.series)
|
||||
@ -516,6 +517,12 @@ export default Vue.extend({
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
async loadAvailableTags() {
|
||||
this.tagsAvailable = await this.$komgaReferential.getTags()
|
||||
},
|
||||
async loadAvailableGenres() {
|
||||
this.genresAvailable = await this.$komgaReferential.getGenres()
|
||||
},
|
||||
requiredErrors(fieldName: string): string[] {
|
||||
const errors = [] as string[]
|
||||
const formField = this.$v.form!![fieldName] as any
|
||||
|
Loading…
Reference in New Issue
Block a user