Skip to content

Commit

Permalink
Merge branch 'app' into app-publish
Browse files Browse the repository at this point in the history
  • Loading branch information
chriscant committed Jul 8, 2023
2 parents f28a404 + 9ea9564 commit 9aab8d5
Show file tree
Hide file tree
Showing 24 changed files with 302 additions and 890 deletions.
4 changes: 2 additions & 2 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ android {
applicationId "org.ilovefreegle.direct"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1207
versionName "3.0.5"
versionCode 1208
versionName "3.0.6"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
aaptOptions {
// Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps.
Expand Down
4 changes: 3 additions & 1 deletion api/NotificationAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ import BaseAPI from '@/api/BaseAPI'

export default class NotificationAPI extends BaseAPI {
count() {
// Don't log errors - this can happen due to timing windows.
return this.$getv2('/notification/count', {}, false)
}

list() {
return this.$getv2('/notification')
// Don't log errors - this can happen due to timing windows.
return this.$getv2('/notification', {}, false)
}

seen(id) {
Expand Down
3 changes: 0 additions & 3 deletions capacitor.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,6 @@ const config: CapacitorConfig = {
PushNotifications: {
presentationOptions: ["badge", "sound", "alert"],
},
FirebaseMessaging: {
presentationOptions: ["badge", "sound", "alert"],
},
Badge: {
"persist": true,
"autoClear": false
Expand Down
63 changes: 63 additions & 0 deletions components/AdTest.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
<template>
<!--
We're testing the possibility of using some different ads. If you don't like ads, then you
can use an ad blocker. Plus you could donate to us at https://www.ilovefreegle.org/donate - if we got
enough donations we would be delighted not to show ads.
-->
<div :ref="uniqueid" class="d-flex justify-content-end pb-2">
<div :id="uniqueid" style="min-width: 300px; min-height: 250px" />
</div>
</template>
<script setup>
import { ref, onMounted, onBeforeUnmount } from '#imports'
import { waitForRef } from '~/composables/useWaitForRef'
// This must match what has been set up in GPT admin.
const uniqueid = ref('div-gpt-ad-1610613658342-0')
const p = new Promise((resolve, reject) => {
const already = document.getElementById('gpt-script')
if (already) {
console.log('Script already there')
resolve()
} else {
const s = document.createElement('script')
s.setAttribute(
'src',
'https://securepubads.g.doubleclick.net/tag/js/gpt.js'
)
s.id = 'gpt-script'
s.onload = () => resolve()
document.head.appendChild(s)
}
})
await p
let slot = null
onMounted(async () => {
await waitForRef(uniqueid)
window.googletag = window.googletag || { cmd: [] }
window.googletag.cmd.push(function () {
slot = window.googletag
.defineSlot('/22794232631/freegle_test1', [300, 250], uniqueid.value)
.addService(window.googletag.pubads())
window.googletag.pubads().enableSingleRequest()
window.googletag.enableServices()
})
window.googletag.cmd.push(function () {
window.googletag.display(uniqueid.value)
console.log('Displayed slot', uniqueid.value)
})
})
onBeforeUnmount(() => {
console.log('Destroy slot', uniqueid.value)
if (window.googletag?.destroySlots) {
window.googletag.destroySlots([slot])
}
})
</script>
11 changes: 7 additions & 4 deletions components/CommunityEvent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,14 @@ export default {
if (props.id) {
const v = await communityEventStore.fetch(props.id)
await userStore.fetch(v.userid)
v.groups?.forEach(async (id) => {
await groupStore.fetch(id)
})
if (v) {
await userStore.fetch(v.userid)
v.groups?.forEach(async (id) => {
await groupStore.fetch(id)
})
}
}
return {
Expand Down
2 changes: 1 addition & 1 deletion components/CommunityFeature.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ const modal = ref(null)
const showModal = async () => {
showAdd.value = true
await waitForRef(modal)
await waitForRef(modal.value)
modal.value.show()
}
</script>
Expand Down
24 changes: 13 additions & 11 deletions components/IsoChrone.vue
Original file line number Diff line number Diff line change
Expand Up @@ -295,18 +295,20 @@ export default {
this.pc = null
},
async add() {
await this.isochroneStore.add({
minutes: this.minutes,
transport: this.transport,
locationid: this.pc.id,
nickname: this.nickname,
})
if (this.pc) {
await this.isochroneStore.add({
minutes: this.minutes,
transport: this.transport,
locationid: this.pc.id,
nickname: this.nickname,
})

this.minutes = 25
this.transport = null
this.pc = null
this.nickname = null
this.$emit('added')
this.minutes = 25
this.transport = null
this.pc = null
this.nickname = null
this.$emit('added')
}
},
remove() {
this.isochroneStore.delete({
Expand Down
5 changes: 5 additions & 0 deletions components/JobsSidebar.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
<template>
<aside v-if="location">
<client-only>
<AdTest />
</client-only>
<NoticeMessage v-if="blocked" variant="warning" class="d-none">
<h3>Please help keep Freegle running</h3>
<p>
Expand Down Expand Up @@ -45,12 +48,14 @@ import { mapState } from 'pinia'
import { useJobStore } from '../stores/job'
import { useAuthStore } from '../stores/auth'
import JobOne from './JobOne'
import AdTest from './AdTest'
import InfiniteLoading from '~/components/InfiniteLoading'
const NoticeMessage = () => import('~/components/NoticeMessage')
const DonationButton = () => import('~/components/DonationButton')
export default {
components: {
AdTest,
JobOne,
NoticeMessage,
InfiniteLoading,
Expand Down
22 changes: 20 additions & 2 deletions components/MyMessage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -470,6 +470,18 @@ export default {
return rejected
},
promisedUserids() {
const ret = []
if (this.message?.promisecount && this.message.promises?.length) {
for (const promise of this.message.promises) {
ret.push(promise.userid)
}
}
return ret
},
replies() {
// Show the replies with unseen messages first, then most recent
// console.log('Sort replies', this.message.replies, this)
Expand All @@ -481,8 +493,14 @@ export default {
const bunseen = self.countUnseen(b)
const adate = new Date(a.date).getTime()
const bdate = new Date(b.date).getTime()
if (aunseen !== bunseen) {
const promisea = this.promisedUserids.includes(a.userid)
const promiseb = this.promisedUserids.includes(b.userid)
if (promisea && !promiseb) {
return -1
} else if (promiseb && !promisea) {
return 1
} else if (aunseen !== bunseen) {
return bunseen - aunseen
} else {
return bdate - adate
Expand Down
4 changes: 2 additions & 2 deletions components/MyMessagePromisedTo.vue
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
<div v-else>
<!-- eslint-disable-next-line-->
<v-icon icon="handshake" class="fa-fw mt-1" />&nbsp;Promised to <strong>{{ promise.name }}</strong><span v-if="promise.trystdate">,</span>
<b-btn
<b-button
variant="link"
class="ml-2 text--smallest text-black"
@click="unpromise"
>(Unpromise)</b-btn
>(Unpromise)</b-button
>
</div>
<div v-if="promise.trystdate" class="d-flex">
Expand Down
2 changes: 1 addition & 1 deletion components/NewsThread.vue
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
:class="newsfeed.deleted ? 'strike mr-1' : 'mr-1'"
@rendered="rendered"
/>
<span v-if="!newsfeed.closed">
<span v-if="!newsfeed?.closed">
<div v-if="enterNewLine">
<OurAtTa
ref="at"
Expand Down
10 changes: 6 additions & 4 deletions components/VolunteerOpportunity.vue
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,13 @@ export default {
if (props.id) {
const v = await volunteeringStore.fetch(props.id)
await userStore.fetch(v.userid)
if (v) {
await userStore.fetch(v.userid)
v.groups?.forEach(async (id) => {
await groupStore.fetch(id)
})
v.groups?.forEach(async (id) => {
await groupStore.fetch(id)
})
}
}
return {
Expand Down
2 changes: 1 addition & 1 deletion config.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,5 @@ export default {
'https://[email protected]/4504083802226688',

ISAPP: process.env.IZNIK_NUXT3_IS_APP === 'true',
MOBILE_VERSION: '3.0.5',
MOBILE_VERSION: '3.0.6',
}
Loading

0 comments on commit 9aab8d5

Please sign in to comment.