Separated stash create dialog component.

This commit is contained in:
2024-08-04 23:40:25 +02:00
parent 164f91eabd
commit d370b35490
8 changed files with 110 additions and 66 deletions

View File

@@ -21,6 +21,7 @@
:item-stashes="itemStashes"
@stash="(stash) => stashItem(stash)"
@unstash="(stash) => unstashItem(stash)"
@create="showStashDialog = true"
/>
</template>
</VDropdown>
@@ -74,20 +75,27 @@
:item-stashes="itemStashes"
@stash="(stash) => stashItem(stash)"
@unstash="(stash) => unstashItem(stash)"
@create="showStashDialog = true"
/>
</template>
</VDropdown>
<StashDialog
v-if="showStashDialog"
@created="showStashDialog = false; reloadStashes();"
/>
</div>
</template>
<script setup>
import { ref, computed, inject } from 'vue';
import { post, del } from '#/src/api.js';
import { get, post, del } from '#/src/api.js';
import ellipsis from '#/utils/ellipsis.js';
import Icon from '#/components/icon/icon.vue';
import StashMenu from '#/components/stashes/menu.vue';
import StashDialog from '#/components/stashes/create.vue';
const props = defineProps({
domain: {
@@ -114,6 +122,7 @@ const hasSecondaryStash = computed(() => itemStashes.value.some((itemStash) => !
const done = ref(true);
const showStashes = ref(false);
const showStashDialog = ref(false);
const feedbackCutoff = 20;
const itemKeys = {
@@ -182,6 +191,12 @@ function toggleShowStashes(state) {
showStashes.value = !showStashes.value;
}
async function reloadStashes() {
const profile = await get(`/users/${user.id}`);
console.log(profile);
}
</script>
<style scoped>