Skip to content

Commit

Permalink
Merge production. Fix push sound again. Cope with android deleted on …
Browse files Browse the repository at this point in the history
…production
  • Loading branch information
chriscant committed Jul 29, 2023
2 parents 4149325 + ceb9845 commit 157a297
Show file tree
Hide file tree
Showing 71 changed files with 284 additions and 241 deletions.
15 changes: 15 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM node:18-alpine

WORKDIR /app

ENV IZNIK_API_V1=http://apiv1/api \
IZNIK_API_V2=http://apiv2:8192/api

RUN apk update && apk add git \
&& git clone https://github.com/Freegle/iznik-nuxt3.git

CMD cd iznik-nuxt3 \
&& git pull \
&& yes | npm install -y --legacy-peer-deps \
&& export NODE_OPTIONS=--max-old-space-size=8192;npm run build \
&& npm run start

This file was deleted.

This file was deleted.

17 changes: 17 additions & 0 deletions api/BaseAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,23 @@ export default class BaseAPI {
)
}

$postv2(path, data, logError = true) {
const authStore = useAuthStore()

return this.$requestv2(
'POST',
path,
{
headers: {
'Content-Type': 'application/json',
Authorization: 'Iznik ' + JSON.stringify(authStore.auth?.persistent),
},
data,
},
logError
)
}

$postForm(path, data, logError = true) {
// Don't set Content-Type - see https://stackoverflow.com/questions/39280438/fetch-missing-boundary-in-multipart-form-data-post
return this.$request(
Expand Down
15 changes: 4 additions & 11 deletions api/ChatAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ export default class ChatAPI extends BaseAPI {
return this.$getv2(`/chat/${chatid}/message`)
}

async listChats(since, search, logError, empty) {
async listChats(since, search, keepChat, logError) {
return await this.$getv2(
'/chat',
{
since,
search,
empty,
keepChat,
},
logError
)
Expand All @@ -33,15 +33,8 @@ export default class ChatAPI extends BaseAPI {
return this.$put('/chat/rooms', params, logError)
}

send(data) {
return this.$post('/chatmessages', data, function (data) {
if (data && data.ret === 4) {
// Don't log errors for banned users - handled elsewhere.
return false
} else {
return true
}
})
async send(data) {
return await this.$postv2('/chat/' + data.roomid + '/message', data)
}

nudge(chatid) {
Expand Down
8 changes: 4 additions & 4 deletions components/ChatFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,7 @@ export default {
},
async nudge() {
await this.waitForRef('nudgewarning')
this.$refs.nudgewarning.show()
this.$refs.nudgewarning?.show()
},
newline() {
const p = this.$refs.chatarea.selectionStart
Expand All @@ -405,7 +405,7 @@ export default {
this.showAddress = true
await this.waitForRef('addressModal')
this.$refs.addressModal.show()
this.$refs.addressModal?.show()
},
photoAdd() {
// Flag that we're uploading. This will trigger the render of the filepond instance and subsequently the
Expand Down Expand Up @@ -445,7 +445,7 @@ export default {
async showInfo() {
this.showProfile = true
await this.waitForRef('profile')
this.$refs.profile.show()
this.$refs.profile?.show()
},
async send() {
let msg = this.sendmessage
Expand Down Expand Up @@ -477,7 +477,7 @@ export default {
if (RSVP) {
this.RSVP = true
await this.waitForRef('rsvp')
this.$refs.rsvp.show()
this.$refs.rsvp?.show()
} else {
// We've sent a message. This would be a good time to do some microvolunteering.
this.showMicrovolunteering = true
Expand Down
15 changes: 10 additions & 5 deletions components/ChatHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,12 @@
:chatid="chat.id"
@confirm="hide"
/>
<ProfileModal v-if="showProfile" :id="otheruser.id" ref="profile" close-on-message />
<ProfileModal
v-if="showProfile"
:id="otheruser.id"
ref="profile"
close-on-message
/>
</div>
<ChatHideModal
v-if="
Expand Down Expand Up @@ -341,22 +346,22 @@ export default {
async showhide() {
this.showChatHide = true
await this.waitForRef('chathide')
this.$refs.chathide.show()
this.$refs.chathide?.show()
},
async showblock() {
this.showChatBlock = true
await this.waitForRef('chatblock')
this.$refs.chatblock.show()
this.$refs.chatblock?.show()
},
async showInfo() {
this.showProfile = true
await this.waitForRef('profile')
this.$refs.profile.show()
this.$refs.profile?.show()
},
async report() {
this.showChatReport = true
await this.waitForRef('chatreport')
this.$refs.chatreport.show()
this.$refs.chatreport?.show()
},
async markRead() {
await this.chatStore.markRead(this.id)
Expand Down
2 changes: 1 addition & 1 deletion components/ChatMessageDateRead.vue
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ export default {
async viewOriginal() {
this.showOriginal = true
await this.waitForRef('original')
this.$refs.original.show()
this.$refs.original?.show()
},
},
}
Expand Down
2 changes: 1 addition & 1 deletion components/ChatMessageInterested.vue
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ export default {
this.showPromise = true
await this.waitForRef('promiseModal')
this.$refs.promiseModal.show()
this.$refs.promiseModal?.show()
},
async outcome(type, e) {
if (e) {
Expand Down
4 changes: 2 additions & 2 deletions components/ChatMessagePromised.vue
Original file line number Diff line number Diff line change
Expand Up @@ -294,13 +294,13 @@ export default {
async unpromise() {
this.showRenege = true
await this.waitForRef('renege')
this.$refs.renege.show()
this.$refs.renege?.show()
fetchOurOffers()
},
async changeTime() {
this.showPromise = true
await this.waitForRef('promise')
this.$refs.promise.show()
this.$refs.promise?.show()
},
fetchMessages() {
this.chatStore.fetchMessages(this.chatmessage.chatid)
Expand Down
2 changes: 1 addition & 1 deletion components/CommunityEvent.vue
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ export default {
async showEventModal() {
this.showModal = true
await this.waitForRef('eventmodal')
this.$refs.eventmodal.show()
this.$refs.eventmodal?.show()
},
},
}
Expand Down
2 changes: 1 addition & 1 deletion components/CommunityFeature.vue
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ const modal = ref(null)
const showModal = async () => {
showAdd.value = true
await waitForRef(modal.value)
modal.value.show()
modal.value?.show()
}
</script>
<style scoped lang="scss">
Expand Down
4 changes: 2 additions & 2 deletions components/EmailBelongsToSomeoneElse.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<p>
{{ theirs }} belongs to a different account from the one you're using
right now.
<span v-if="me.email"> ({{ me.email }}) </span>
<span v-if="me?.email"> ({{ me.email }}) </span>
. But don't worry! You probably have two acounts, and we can merge them
together.
</p>
Expand Down Expand Up @@ -54,7 +54,7 @@ export default {
email: this.theirs,
})
console.log('data', data)
console.log('Merge data', data)
this.showConfirm = true
},
Expand Down
2 changes: 1 addition & 1 deletion components/GroupHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ export default {
} else {
this.joiningOrLeaving = true
await this.authStore.joinGroup(this.myid, this.group.id)
await this.authStore.joinGroup(this.myid, this.group.id, true)
this.joiningOrLeaving = false
}
Expand Down
15 changes: 10 additions & 5 deletions components/IsoChrone.vue
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@
:max="maxMinutes"
:step="step"
class="pt-2"
@change="changeMinutes"
/>
<b-button
variant="white"
Expand Down Expand Up @@ -182,12 +181,12 @@ export default {
const isochroneStore = useIsochroneStore()
const locationStore = useLocationStore()
let minutes = ref(20)
let transport = ref('Drive')
const minutes = ref(20)
const transport = ref('Drive')
if (props.id) {
minutes = isochroneStore.get(props.id).minutes
transport = isochroneStore.get(props.id).transport
minutes.value = isochroneStore.get(props.id).minutes
transport.value = isochroneStore.get(props.id).transport
}
const isochrone = computed(() => {
Expand Down Expand Up @@ -257,6 +256,12 @@ export default {
return ret
},
},
watch: {
minutes(newVal) {
console.log('watch', newVal)
this.changeMinutes(newVal)
},
},
methods: {
increment() {
this.minutes = Math.min(this.minutes + this.step, this.maxMinutes)
Expand Down
6 changes: 3 additions & 3 deletions components/JobsSidebar.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<aside v-if="location">
<client-only>
<AdTest square />
<!-- <AdTest square />-->
</client-only>
<NoticeMessage v-if="blocked" variant="warning" class="d-none">
<h3>Please help keep Freegle running</h3>
Expand Down Expand Up @@ -48,14 +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 AdTest from './AdTest'
import InfiniteLoading from '~/components/InfiniteLoading'
const NoticeMessage = () => import('~/components/NoticeMessage')
const DonationButton = () => import('~/components/DonationButton')
export default {
components: {
AdTest,
// AdTest,
JobOne,
NoticeMessage,
InfiniteLoading,
Expand Down
6 changes: 3 additions & 3 deletions components/JobsTopBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
</li>
</ul>
<client-only>
<AdTest :key="'adbanner-' + miscStore.breakpoint" banner />
<!-- <AdTest :key="'adbanner-' + miscStore.breakpoint" banner />-->
</client-only>
</div>
</div>
Expand All @@ -45,14 +45,14 @@ import { mapState } from 'pinia'
import { useJobStore } from '../stores/job'
import { useAuthStore } from '../stores/auth'
import { useMiscStore } from '../stores/misc'
import AdTest from './AdTest'
// import AdTest from './AdTest'
const JobOne = () => import('./JobOne')
const NoticeMessage = () => import('./NoticeMessage')
const DonationButton = () => import('./DonationButton')
export default {
components: {
AdTest,
// AdTest,
NoticeMessage,
JobOne,
DonationButton,
Expand Down
2 changes: 1 addition & 1 deletion components/JoinWithConfirm.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default {
async confirm() {
this.showConfirm = true
await this.waitForRef('joinConfirm')
this.$refs.joinConfirm.show()
this.$refs.joinConfirm?.show()
},
confirmed() {
const router = useRouter()
Expand Down
2 changes: 1 addition & 1 deletion components/MainHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ const showAboutMe = async () => {
showAboutMeModal.value = true
await waitForRef('modal')
aboutMeModal.value.show()
aboutMeModal.value?.show()
}
const refresh = () => { // IS_APP
Expand Down
Loading

0 comments on commit 157a297

Please sign in to comment.