Skip to content

Commit

Permalink
Update prettier version
Browse files Browse the repository at this point in the history
  • Loading branch information
AchoArnold committed Aug 2, 2023
1 parent b42f880 commit c38e3a0
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 41 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: 11 additions & 8 deletions web/layouts/default.vue
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,14 @@ 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 @@ -62,7 +65,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 @@ -74,8 +77,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
2 changes: 1 addition & 1 deletion web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"jest": "^27.4.4",
"lint-staged": "^13.2.2",
"postcss-html": "^1.5.0",
"prettier": "^2.8.8",
"prettier": "3.0.0",
"stylelint": "^15.10.2",
"stylelint-config-prettier": "^9.0.5",
"stylelint-config-recommended-vue": "^1.5.0",
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
7 changes: 6 additions & 1 deletion web/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -11711,7 +11711,12 @@ prepend-http@^1.0.0:
resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-1.0.4.tgz#d4f4562b0ce3696e41ac52d0e002e57a635dc6dc"
integrity sha512-PhmXi5XmoyKw1Un4E+opM2KcsJInDvKyuOumcjjw3waw86ZNjHwVUOOWLc4bCzLdcKNaWBH9e99sbWzDQsVaYg==

"prettier@^1.18.2 || ^2.0.0", prettier@^2.8.8:
[email protected]:
version "3.0.0"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-3.0.0.tgz#e7b19f691245a21d618c68bc54dc06122f6105ae"
integrity sha512-zBf5eHpwHOGPC47h0zrPyNn+eAEIdEzfywMoYn2XPi0P44Zp0tSq64rq0xAREh4auw2cJZHo9QUob+NqCQky4g==

"prettier@^1.18.2 || ^2.0.0":
version "2.8.8"
resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da"
integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==
Expand Down

0 comments on commit c38e3a0

Please sign in to comment.