Image load shortcut
This commit is contained in:
parent
50ef1f3c15
commit
e538a963fd
|
@ -51,7 +51,7 @@
|
||||||
<character-groups :character="character" ref="tab2"></character-groups>
|
<character-groups :character="character" ref="tab2"></character-groups>
|
||||||
</div>
|
</div>
|
||||||
<div role="tabpanel" v-show="tab === '3'">
|
<div role="tabpanel" v-show="tab === '3'">
|
||||||
<character-images :character="character" ref="tab3" :use-preview="imagePreview"></character-images>
|
<character-images :character="character" ref="tab3" :use-preview="imagePreview" :injected-images="images"></character-images>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="character.settings.guestbook" role="tabpanel" v-show="tab === '4'" id="guestbook">
|
<div v-if="character.settings.guestbook" role="tabpanel" v-show="tab === '4'" id="guestbook">
|
||||||
<character-guestbook :character="character" :oldApi="oldApi" ref="tab4"></character-guestbook>
|
<character-guestbook :character="character" :oldApi="oldApi" ref="tab4"></character-guestbook>
|
||||||
|
|
|
@ -38,6 +38,9 @@
|
||||||
private readonly character!: Character;
|
private readonly character!: Character;
|
||||||
@Prop
|
@Prop
|
||||||
private readonly usePreview?: boolean;
|
private readonly usePreview?: boolean;
|
||||||
|
@Prop
|
||||||
|
private readonly injectedImages?: CharacterImage[] | null;
|
||||||
|
|
||||||
private shown = false;
|
private shown = false;
|
||||||
previewImage = '';
|
previewImage = '';
|
||||||
images: CharacterImage[] = [];
|
images: CharacterImage[] = [];
|
||||||
|
@ -64,6 +67,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
async resolveImages(): Promise<CharacterImage[]> {
|
async resolveImages(): Promise<CharacterImage[]> {
|
||||||
|
if ((this.injectedImages) && (this.injectedImages.length)) {
|
||||||
|
return this.injectedImages;
|
||||||
|
}
|
||||||
|
|
||||||
const c = await core.cache.profileCache.get(this.character.character.name);
|
const c = await core.cache.profileCache.get(this.character.character.name);
|
||||||
|
|
||||||
if ((c) && (c.meta) && (c.meta.images)) {
|
if ((c) && (c.meta) && (c.meta.images)) {
|
||||||
|
|
Loading…
Reference in New Issue