Image load shortcut

This commit is contained in:
Mr. Stallion 2020-04-12 10:13:28 -05:00
parent 50ef1f3c15
commit e538a963fd
2 changed files with 9 additions and 2 deletions

View File

@ -51,7 +51,7 @@
<character-groups :character="character" ref="tab2"></character-groups>
</div>
<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 v-if="character.settings.guestbook" role="tabpanel" v-show="tab === '4'" id="guestbook">
<character-guestbook :character="character" :oldApi="oldApi" ref="tab4"></character-guestbook>

View File

@ -38,6 +38,9 @@
private readonly character!: Character;
@Prop
private readonly usePreview?: boolean;
@Prop
private readonly injectedImages?: CharacterImage[] | null;
private shown = false;
previewImage = '';
images: CharacterImage[] = [];
@ -64,6 +67,10 @@
}
async resolveImages(): Promise<CharacterImage[]> {
if ((this.injectedImages) && (this.injectedImages.length)) {
return this.injectedImages;
}
const c = await core.cache.profileCache.get(this.character.character.name);
if ((c) && (c.meta) && (c.meta.images)) {
@ -80,4 +87,4 @@
}
}
}
</script>
</script>