Skip to content

Commit

Permalink
Fixing prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
AchoArnold committed Jul 26, 2023
1 parent 38266de commit 6a1b1af
Show file tree
Hide file tree
Showing 10 changed files with 45 additions and 48 deletions.
4 changes: 2 additions & 2 deletions web/components/FirebaseAuth.vue
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export default class FirebaseAuth extends Vue {
return {
callbacks: {
signInSuccessWithAuthResult: (
authResult: firebase.auth.UserCredential,
authResult: firebase.auth.UserCredential
) => {
this.$store.dispatch('addNotification', {
message: 'Login successfull!',
Expand All @@ -66,7 +66,7 @@ export default class FirebaseAuth extends Vue {
this.firebaseUIInitialized = true
const container = this.$refs.authContainer as HTMLElement
Array.from(
container.getElementsByClassName('firebaseui-idp-text-long'),
container.getElementsByClassName('firebaseui-idp-text-long')
).forEach((item: Element) => {
item.textContent =
item.textContent?.replace('Sign in with', 'Continue with') || null
Expand Down
2 changes: 1 addition & 1 deletion web/components/MessageThreadHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export default class MessageThreadHeader extends Vue {
text: this.$options.filters?.phoneNumber(phone.phone_number),
value: phone.phone_number,
}
},
}
)
}
Expand Down
19 changes: 8 additions & 11 deletions web/layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,11 @@ export default class DefaultLayout extends Vue {
mounted() {
// this.startPoller()
setTimeout(
() => {
if (this.poller) {
clearInterval(this.poller)
}
},
60 * 1000 * 60,
)
setTimeout(() => {
if (this.poller) {
clearInterval(this.poller)
}
}, 60 * 1000 * 60)
}
beforeDestroy(): void {
Expand All @@ -65,7 +62,7 @@ export default class DefaultLayout extends Vue {
setAuthHeader((await this.$fire.auth.currentUser?.getIdToken()) ?? '')
promises.push(
this.$store.dispatch('loadThreads'),
this.$store.dispatch('getHeartbeat'),
this.$store.dispatch('getHeartbeat')
)
}
Expand All @@ -77,8 +74,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)
Expand Down
12 changes: 6 additions & 6 deletions web/pages/billing/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,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>
Expand All @@ -64,7 +64,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>
Expand Down Expand Up @@ -116,7 +116,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>
Expand Down Expand Up @@ -238,8 +238,8 @@
<div class="d-flex">
<h2 class="text-h4 font-weight-bold mt-4">
{{
$store.getters.getBillingUsage.received_messages
| decimal
$store.getters.getBillingUsage.received_messages |
decimal
}}
</h2>
</div>
Expand Down Expand Up @@ -411,7 +411,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 {
Expand Down
4 changes: 2 additions & 2 deletions web/pages/heartbeats/_id.vue
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export default {
if (index < this.heartbeats.length - 1) {
interval = this.getDiff(
heartbeat.timestamp,
this.heartbeats[index + 1].timestamp,
this.heartbeats[index + 1].timestamp
)
}
const item = {
Expand Down Expand Up @@ -148,7 +148,7 @@ export default {
}
const duration = intervalToDuration({
start: new Date(
context.dataset.data[context.dataIndex + 1].x,
context.dataset.data[context.dataIndex + 1].x
),
end: new Date(context.dataset.data[context.dataIndex].x),
})
Expand Down
4 changes: 2 additions & 2 deletions web/pages/messages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ export default {
errors.set(
'to',
response.data.data.to.map((x) =>
x.replace('to field', 'phone number field'),
),
x.replace('to field', 'phone number field')
)
)
}
if (response.data.data.from) {
Expand Down
4 changes: 2 additions & 2 deletions web/pages/settings/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -738,7 +738,7 @@ export default Vue.extend({
id: webhook.id,
url: webhook.url,
phone_numbers: webhook.phone_numbers.filter(
(x) => this.phoneNumbers.find((y) => y === x) !== undefined,
(x) => this.phoneNumbers.find((y) => y === x) !== undefined
),
signing_key: webhook.signing_key,
events: webhook.events,
Expand Down Expand Up @@ -768,7 +768,7 @@ export default Vue.extend({
url: '',
signing_key: '',
phone_numbers: this.$store.getters.getPhones.map(
(phone) => phone.phone_number,
(phone) => phone.phone_number
),
events: [
'message.phone.received',
Expand Down
2 changes: 1 addition & 1 deletion web/plugins/chart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ ChartJS.register(
CategoryScale,
LinearScale,
LineElement,
ArcElement,
ArcElement
)

Vue.component('BarChart', {
Expand Down
2 changes: 1 addition & 1 deletion web/plugins/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const sanitize = (key: string, values: Array<string>): Array<string> => {
.split(' char')
.join(' character')
.split(' field ')
.join(' '),
.join(' ')
)
})
}
Expand Down
40 changes: 20 additions & 20 deletions web/store/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ export const actions = {

if (context.state.user && context.state.user.active_phone_id) {
const phone = response.data.data.find(
(x: EntitiesPhone) => x.id === context.state.user?.active_phone_id,
(x: EntitiesPhone) => x.id === context.state.user?.active_phone_id
)
if (phone) {
context.commit('setOwner', phone.phone_number)
Expand All @@ -351,15 +351,15 @@ export const actions = {

async updatePhone(
context: ActionContext<State, State>,
phone: EntitiesPhone,
phone: EntitiesPhone
) {
await axios
.put(`/v1/phones`, {
fcm_token: phone.fcm_token,
sim: phone.sim,
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()),
Expand All @@ -379,7 +379,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]
Expand All @@ -394,7 +394,7 @@ export const actions = {

getHeartbeat(
context: ActionContext<State, State>,
limit = 1,
limit = 1
): Promise<Array<Heartbeat>> {
return new Promise<Array<Heartbeat>>((resolve, reject) => {
axios
Expand Down Expand Up @@ -430,7 +430,7 @@ export const actions = {

async sendMessage(
context: ActionContext<State, State>,
request: SendMessageRequest,
request: SendMessageRequest
) {
try {
const response = await axios.post('/v1/messages/send', request)
Expand All @@ -455,7 +455,7 @@ export const actions = {

addNotification(
context: ActionContext<State, State>,
request: NotificationRequest,
request: NotificationRequest
) {
context.commit('setNotification', request)
},
Expand All @@ -466,7 +466,7 @@ export const actions = {

loadThreadMessages(
context: ActionContext<State, State>,
threadId: string | null,
threadId: string | null
): Promise<Array<Message>> {
context.commit('setThreadId', threadId)
return new Promise<Array<Message>>((resolve, reject) => {
Expand Down Expand Up @@ -494,7 +494,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

Expand All @@ -511,7 +511,7 @@ export const actions = {
])

const phone = context.getters.getPhones.find(
(x: EntitiesPhone) => x.id === context.getters.getUser.active_phone_id,
(x: EntitiesPhone) => x.id === context.getters.getUser.active_phone_id
)
if (phone) {
await context.dispatch('updateUser', {
Expand All @@ -524,7 +524,7 @@ export const actions = {
async onAuthStateChanged(
context: ActionContext<State, State>,
// @ts-ignore
{ authUser },
{ authUser }
) {
if (authUser == null) {
await Promise.all([
Expand All @@ -544,7 +544,7 @@ export const actions = {
async onIdTokenChanged(
_: ActionContext<State, State>,
// @ts-ignore
{ authUser },
{ authUser }
) {
if (authUser == null) {
setApiKey('')
Expand All @@ -559,7 +559,7 @@ export const actions = {

async updateUser(
context: ActionContext<State, State>,
payload: { owner: string; timezone: string },
payload: { owner: string; timezone: string }
) {
await context.commit('setOwner', payload.owner)

Expand All @@ -579,7 +579,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,
Expand Down Expand Up @@ -632,7 +632,7 @@ export const actions = {

createDiscord(
context: ActionContext<State, State>,
payload: RequestsDiscordStore,
payload: RequestsDiscordStore
): Promise<EntitiesDiscord> {
return new Promise<EntitiesDiscord>((resolve, reject) => {
axios
Expand Down Expand Up @@ -681,13 +681,13 @@ export const actions = {

updateDiscordIntegration(
context: ActionContext<State, State>,
payload: RequestsDiscordUpdate & { id: string },
payload: RequestsDiscordUpdate & { id: string }
) {
return new Promise<EntitiesDiscord>((resolve, reject) => {
axios
.put<ResponsesDiscordResponse>(
`/v1/discord-integrations/${payload.id}`,
payload,
payload
)
.then((response: AxiosResponse<ResponsesDiscordResponse>) => {
resolve(response.data.data)
Expand All @@ -708,7 +708,7 @@ export const actions = {

deleteDiscordIntegration(
context: ActionContext<State, State>,
payload: string,
payload: string
) {
return new Promise<void>((resolve, reject) => {
axios
Expand All @@ -732,7 +732,7 @@ export const actions = {

createWebhook(
context: ActionContext<State, State>,
payload: RequestsWebhookStore,
payload: RequestsWebhookStore
) {
return new Promise<EntitiesWebhook>((resolve, reject) => {
axios
Expand Down Expand Up @@ -780,7 +780,7 @@ export const actions = {

updateWebhook(
context: ActionContext<State, State>,
payload: RequestsWebhookUpdate & { id: string },
payload: RequestsWebhookUpdate & { id: string }
) {
return new Promise<EntitiesWebhook>((resolve, reject) => {
axios
Expand Down

0 comments on commit 6a1b1af

Please sign in to comment.