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