diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..35dc2fc5 --- /dev/null +++ b/Dockerfile @@ -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 \ No newline at end of file diff --git a/android/app/build.gradle b/android/app/build.gradle index fa775e1d..fd1582c3 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -6,8 +6,8 @@ android { applicationId "org.ilovefreegle.direct" minSdkVersion rootProject.ext.minSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion - versionCode 1209 - versionName "3.0.7" + versionCode 1212 + versionName "3.0.10" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" aaptOptions { // Files and dirs to omit from the packaged assets dir, modified to accommodate modern web apps. diff --git a/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java b/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java deleted file mode 100644 index f2c2217e..00000000 --- a/android/app/src/androidTest/java/com/getcapacitor/myapp/ExampleInstrumentedTest.java +++ /dev/null @@ -1,26 +0,0 @@ -package com.getcapacitor.myapp; - -import static org.junit.Assert.*; - -import android.content.Context; -import androidx.test.ext.junit.runners.AndroidJUnit4; -import androidx.test.platform.app.InstrumentationRegistry; -import org.junit.Test; -import org.junit.runner.RunWith; - -/** - * Instrumented test, which will execute on an Android device. - * - * @see Testing documentation - */ -@RunWith(AndroidJUnit4.class) -public class ExampleInstrumentedTest { - - @Test - public void useAppContext() throws Exception { - // Context of the app under test. - Context appContext = InstrumentationRegistry.getInstrumentation().getTargetContext(); - - assertEquals("com.getcapacitor.app", appContext.getPackageName()); - } -} diff --git a/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java b/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java deleted file mode 100644 index 02973278..00000000 --- a/android/app/src/test/java/com/getcapacitor/myapp/ExampleUnitTest.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.getcapacitor.myapp; - -import static org.junit.Assert.*; - -import org.junit.Test; - -/** - * Example local unit test, which will execute on the development machine (host). - * - * @see Testing documentation - */ -public class ExampleUnitTest { - - @Test - public void addition_isCorrect() throws Exception { - assertEquals(4, 2 + 2); - } -} diff --git a/api/BaseAPI.js b/api/BaseAPI.js index b3b27495..be10889d 100644 --- a/api/BaseAPI.js +++ b/api/BaseAPI.js @@ -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( diff --git a/api/ChatAPI.js b/api/ChatAPI.js index 245fa990..205b1991 100644 --- a/api/ChatAPI.js +++ b/api/ChatAPI.js @@ -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 ) @@ -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) { diff --git a/capacitor.config.ts b/capacitor.config.ts index 8b77b115..6ba54355 100644 --- a/capacitor.config.ts +++ b/capacitor.config.ts @@ -73,7 +73,8 @@ const config: CapacitorConfig = { }, plugins: { PushNotifications: { - presentationOptions: ["badge", "sound", "alert"], + //presentationOptions: ["badge", "sound", "alert"], + presentationOptions: ["badge", "alert"], }, Badge: { "persist": true, diff --git a/components/AdTest.vue b/components/AdTest.vue index 25acf4c9..ef8b6d6b 100644 --- a/components/AdTest.vue +++ b/components/AdTest.vue @@ -4,21 +4,80 @@ 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. --> -