• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Freegle / iznik-nuxt3 / 933b5598-9b95-4d39-8a74-8e8369383e3c

16 Sep 2025 09:24AM UTC coverage: 45.764% (+0.07%) from 45.697%
933b5598-9b95-4d39-8a74-8e8369383e3c

push

circleci

edwh
Suppress confusing error during login

1780 of 4628 branches covered (38.46%)

Branch coverage included in aggregate %.

4032 of 8072 relevant lines covered (49.95%)

103.53 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

37.84
/components/MessagePromised.vue
1
<template>
2
  <div class="promised" @click="clicked">
3
    <div v-if="summary">
4
      <b-img lazy src="/promised.jpg" class="promised__image" />
5
      <b-popover
6
        v-if="message.fromuser !== myid"
7
        v-model="showing"
8
        :content="title"
9
        placement="top"
10
        variant="primary"
11
        triggers="hover"
12
        :target="'msg-' + id"
13
        custom-class="primary"
14
        @shown="shown"
15
        @hidden="hidden"
16
      />
17
    </div>
18
    <div v-else>
19
      <notice-message v-if="!toMe" variant="warning">
20
        This item has already been promised to someone. You can still reply, but
21
        you'll probably only get it if someone else drops out.
22
      </notice-message>
23
      <notice-message v-else variant="primary">
24
        This has been promised to you.
25
      </notice-message>
26
    </div>
27
  </div>
28
</template>
29
<script setup>
30
import { computed, ref, onBeforeUnmount } from 'vue'
31
import NoticeMessage from './NoticeMessage'
32
import { useMessageStore } from '~/stores/message'
33
import { useMe } from '~/composables/useMe'
34

35
const props = defineProps({
1✔
36
  id: {
37
    type: Number,
38
    required: true,
39
  },
40
  toMe: {
41
    type: Boolean,
42
    required: false,
43
    default: false,
44
  },
45
  summary: {
46
    type: Boolean,
47
    required: false,
48
    default: false,
49
  },
50
})
51

52
const emit = defineEmits(['click'])
1✔
53

54
const { myid } = useMe()
1✔
55
const messageStore = useMessageStore()
1✔
56

57
let scrollHandler = null
1✔
58
const showing = ref(false)
1✔
59

60
const title = computed(() => {
1✔
61
  if (!props.toMe) {
1!
62
    return "This item has already been promised to someone. You can still reply, but you'll probably only get it if someone else drops out."
1✔
63
  } else {
64
    return 'This has been promised to you.'
×
65
  }
66
})
67

68
const message = computed(() => {
1✔
69
  return messageStore?.byId(props.id)
1!
70
})
71

72
function shown() {
×
73
  if (!scrollHandler) {
×
74
    scrollHandler = window.addEventListener('scroll', handleScroll)
×
75
  }
76
}
77

78
function hidden() {
×
79
  if (scrollHandler) {
×
80
    window.removeEventListener('scroll', handleScroll)
×
81
    scrollHandler = null
×
82
  }
83
}
84

85
function handleScroll() {
×
86
  showing.value = false
×
87
}
88

89
function clicked() {
×
90
  emit('click')
×
91
}
92

93
onBeforeUnmount(() => {
1✔
94
  if (scrollHandler) {
×
95
    window.removeEventListener('scroll', scrollHandler)
×
96
    scrollHandler = null
×
97
  }
98
})
99
</script>
100
<style scoped lang="scss">
101
@import 'bootstrap/scss/_functions';
102
@import 'bootstrap/scss/_variables';
103
@import 'bootstrap/scss/mixins/_breakpoints';
104

105
.promised__image {
106
  position: absolute;
107
  z-index: 2;
108
  transform: rotate(15deg);
109
  top: 50%;
110
  left: 50%;
111

112
  width: 150px;
113
  margin-left: -75px;
114

115
  @include media-breakpoint-up(md) {
116
    width: 225px;
117
    margin-left: -125px;
118
  }
119
}
120
</style>
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc