Added elaborate template switching.

This commit is contained in:
2024-08-26 06:15:22 +02:00
parent fa991c0294
commit 80d8a8109a
29 changed files with 617 additions and 180 deletions

View File

@@ -31,19 +31,19 @@
<StashDialog
v-if="showStashDialog"
@created="showStashDialog = false; reloadProfile();"
@created="showStashDialog = false; reloadStashes();"
@close="showStashDialog = false"
/>
<ul class="stashes nolist">
<li
v-for="stash in profile.stashes"
v-for="stash in stashes"
:key="`stash-${stash.id}`"
>
<StashTile
:stash="stash"
:profile="profile"
@reload="reloadProfile"
@reload="reloadStashes"
/>
</li>
</ul>
@@ -224,14 +224,16 @@ import AlertDialog from '#/components/alerts/create.vue';
const pageContext = inject('pageContext');
const user = pageContext.user;
const profile = ref(pageContext.pageProps.profile);
const stashes = ref(pageContext.pageProps.stashes);
const alerts = ref(pageContext.pageProps.alerts);
const done = ref(true);
const showStashDialog = ref(false);
const showAlertDialog = ref(false);
async function reloadProfile() {
profile.value = await get(`/users/${profile.value.id}`);
async function reloadStashes() {
// profile.value = await get(`/users/${profile.value.id}`);
stashes.value = await get(`/users/${profile.value.id}/stashes`);
}
async function reloadAlerts() {