Send and receive SMS messages using your Android phone programmatically via a simple HTTP API
Running prettier
Acho Arnold2d1e9519817c
diff --git a/web/layouts/default.vue b/web/layouts/default.vueindex 4138f817..f8e73db0 100644--- a/web/layouts/default.vue+++ b/web/layouts/default.vue@@ -57,7 +57,7 @@ export default class DefaultLayout extends Vue {if (this.$store.getters.getAuthUser && this.$store.getters.getOwner) {promises.push(this.$store.dispatch('loadThreads'),- this.$store.dispatch('getHeartbeat'),+ this.$store.dispatch('getHeartbeat'))}@@ -69,8 +69,8 @@ export default class DefaultLayout extends Vue {promises.push(this.$store.dispatch('loadThreadMessages',- this.$store.getters.getThread.id,- ),+ this.$store.getters.getThread.id+ ))}await Promise.all(promises)diff --git a/web/middleware/user.ts b/web/middleware/user.tsindex 6be1cc4b..5ada17a0 100644--- a/web/middleware/user.ts+++ b/web/middleware/user.ts@@ -25,7 +25,7 @@ const setUser = (context: Context): Promise<User | null> => {resolve(user)})},- reject,+ reject)})}diff --git a/web/pages/billing/index.vue b/web/pages/billing/index.vueindex 0e67fce3..7fcb8064 100644--- a/web/pages/billing/index.vue+++ b/web/pages/billing/index.vue@@ -41,7 +41,7 @@Your next bill is for <b>${{ plan.price }}</b> on<b>{{new Date(- $store.getters.getUser.subscription_renews_at,+ $store.getters.getUser.subscription_renews_at).toLocaleDateString()}}</b></p>@@ -52,7 +52,7 @@You will be downgraded to the <b>FREE</b> plan on<b>{{new Date(- $store.getters.getUser.subscription_ends_at,+ $store.getters.getUser.subscription_ends_at).toLocaleDateString()}}</b></p>@@ -93,7 +93,7 @@of the current billing period on<b>{{new Date(- $store.getters.getUser.subscription_renews_at,+ $store.getters.getUser.subscription_renews_at).toLocaleDateString()}}</b></p>@@ -370,7 +370,7 @@ export default Vue.extend({plan(): PaymentPlan {return this.plans.find((x) =>- x.id === (this.$store.getters.getUser?.subscription_name || 'free'),+ x.id === (this.$store.getters.getUser?.subscription_name || 'free'))!},isOnFreePlan(): boolean {diff --git a/web/store/index.ts b/web/store/index.tsindex b70fcbf9..a7c209e3 100644--- a/web/store/index.ts+++ b/web/store/index.ts@@ -351,7 +351,7 @@ export const actions = {fcm_token: phone.fcm_token,phone_number: phone.phone_number,message_expiration_seconds: parseInt(- phone.message_expiration_seconds.toString(),+ phone.message_expiration_seconds.toString()),max_send_attempts: parseInt(phone.max_send_attempts.toString()),messages_per_minute: parseInt(phone.messages_per_minute.toString()),@@ -371,7 +371,7 @@ export const actions = {async handleAxiosError(context: ActionContext<State, State>,- error: AxiosError,+ error: AxiosError) {const errorMessage =error.response?.data?.data[Object.keys(error.response?.data?.data)[0]][0]@@ -406,7 +406,7 @@ export const actions = {async sendMessage(context: ActionContext<State, State>,- request: SendMessageRequest,+ request: SendMessageRequest) {await axios.post('/v1/messages/send', request)await Promise.all([@@ -421,7 +421,7 @@ export const actions = {addNotification(context: ActionContext<State, State>,- request: NotificationRequest,+ request: NotificationRequest) {context.commit('setNotification', request)},@@ -436,7 +436,7 @@ export const actions = {async loadThreadMessages(context: ActionContext<State, State>,- threadId: string | null,+ threadId: string | null) {await context.commit('setThreadId', threadId)const response = await axios.get('/v1/messages', {@@ -451,7 +451,7 @@ export const actions = {async setAuthUser(context: ActionContext<State, State>,- user: AuthUser | null | undefined,+ user: AuthUser | null | undefined) {const userChanged = user?.id !== context.getters.getAuthUser?.id@@ -468,7 +468,7 @@ export const actions = {])const phone = context.getters.getPhones.find(- (x: Phone) => x.id === context.getters.getUser.active_phone_id,+ (x: Phone) => x.id === context.getters.getUser.active_phone_id)if (phone) {await context.dispatch('setOwner', phone.phone_number)@@ -478,7 +478,7 @@ export const actions = {async onAuthStateChanged(context: ActionContext<State, State>,// @ts-ignore- { authUser },+ { authUser }) {if (authUser == null) {context.commit('setAuthUser', null)@@ -511,7 +511,7 @@ export const actions = {async updateThread(context: ActionContext<State, State>,- payload: { threadId: string; isArchived: boolean },+ payload: { threadId: string; isArchived: boolean }) {await axios.put(`/v1/message-threads/${payload.threadId}`, {is_archived: payload.isArchived,