Skip to content

Commit

Permalink
hide "reset conversation" when it doesnt start
Browse files Browse the repository at this point in the history
  • Loading branch information
igor-kamil committed Sep 11, 2024
1 parent f2f78ba commit 06f076a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion resources/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const routes = [
path: '/',
component: Settings,
meta: {
title: 'App settings',
title: 'Výber miestnosti:',
},
},
{
Expand Down
8 changes: 6 additions & 2 deletions resources/js/components/Header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</div>
<!-- <LanguageSwitcher v-else-if="route.name === 'home'" /> -->
<!-- <ViewedItemsCount v-else class="flex-1 border-l-2 border-l-transparent px-4 py-2" :show-tooltip="isActive" /> -->
<div class="items-center flex">
<div class="items-center flex" v-if="!interactionStore.isEmpty()">
<button @click="shownResetModal = true" class="flex py-2 text-base font-bold items-center">
<svg
class="w-6 h-6 fill-none stroke-black stroke-2 mr-2"
Expand Down Expand Up @@ -43,7 +43,11 @@
<p>Chceš začať odznova? Konverzácia sa resetuje.</p>
</div>
<div class="flex space-x-6">
<ConfirmButton class="" @click="shownResetModal = false">{{ $t('Close') }}</ConfirmButton>
<ConfirmButton
class=""
@click="shownResetModal = false"
>{{ $t('Close') }}</ConfirmButton
>
<ConfirmButton class="bg-black text-white" @click="resetInteraction">{{ $t('Reset') }}</ConfirmButton>
</div>
</CardModal>
Expand Down
3 changes: 3 additions & 0 deletions resources/js/stores/InteractionStore.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,5 +107,8 @@ export const useInteractionStore = defineStore('InteractionStore', {
clear() {
this.interactions = []
},
isEmpty() {
return this.interactions.length < 2 // 1 story is always present
}
},
})

0 comments on commit 06f076a

Please sign in to comment.