diff --git a/src/api.ts b/src/api.ts index 819b94e..2a4ee1b 100644 --- a/src/api.ts +++ b/src/api.ts @@ -15,7 +15,6 @@ export const fetchToken = async (params: URLSearchParams, errorMessage: string): return (await response.json()) as OAuth.TokenResponse; }; - export const createApp = async (): Promise => { const { instance } = getPreferenceValues(); @@ -37,7 +36,6 @@ export const createApp = async (): Promise => { return (await response.json()) as Credentials; }; - export const postNewStatus = async ({ status, visibility, @@ -53,7 +51,7 @@ export const postNewStatus = async ({ method: "POST", headers: { "Content-Type": "application/json", - "Authorization": "Bearer " + tokenSet?.accessToken, + Authorization: "Bearer " + tokenSet?.accessToken, }, body: JSON.stringify({ status, @@ -70,7 +68,6 @@ export const postNewStatus = async ({ return (await response.json()) as StatusResponse; }; - export const fetchAccountInfo = async (): Promise => { const { instance } = getPreferenceValues(); const tokenSet = await client.getTokens(); @@ -78,7 +75,7 @@ export const fetchAccountInfo = async (): Promise => { const response = await fetch(`https://${instance}/api/v1/accounts/verify_credentials`, { method: "GET", headers: { - "Authorization": "Bearer " + tokenSet?.accessToken, + Authorization: "Bearer " + tokenSet?.accessToken, }, }); diff --git a/src/components/Actions.tsx b/src/components/Actions.tsx index 2d549fb..16404d6 100644 --- a/src/components/Actions.tsx +++ b/src/components/Actions.tsx @@ -1,9 +1,5 @@ const Actions = () => { - return ( - <> - - - ) -} + return <>; +}; -export default Actions +export default Actions; diff --git a/src/components/StatusPreview.tsx b/src/components/StatusPreview.tsx index 6a8e87d..9b5738e 100644 --- a/src/components/StatusPreview.tsx +++ b/src/components/StatusPreview.tsx @@ -1,11 +1,7 @@ -import { Detail } from "@raycast/api" +import { Detail } from "@raycast/api"; const StatusPreview = () => { - return ( -
- -
- ) -} + return
; +}; -export default StatusPreview +export default StatusPreview; diff --git a/src/oauth.ts b/src/oauth.ts index 73f8b5c..a948fb8 100644 --- a/src/oauth.ts +++ b/src/oauth.ts @@ -50,7 +50,7 @@ export const authorize = async (): Promise => { if (tokenSet?.accessToken) { if (tokenSet.refreshToken && tokenSet.isExpired()) { - LocalStorage.clear() + LocalStorage.clear(); const { client_id, client_secret } = await createApp(); await client.setTokens(await refreshToken(client_id, client_secret, tokenSet.refreshToken)); } @@ -63,7 +63,7 @@ export const authorize = async (): Promise => { clientId: client_id, scope: "read write", }); - + const { authorizationCode } = await client.authorize(authRequest); await client.setTokens(await requestAccessToken(client_id, client_secret, authRequest, authorizationCode)); diff --git a/src/types.ts b/src/types.ts index 4bebc89..d8b2405 100644 --- a/src/types.ts +++ b/src/types.ts @@ -63,7 +63,6 @@ export interface Status { visibility: VisibilityScope; } - export interface StatusResponse { id: string; create_at: Date; @@ -77,4 +76,4 @@ export interface Account { display_name: string; fqn: string; avatar_static: string; -} \ No newline at end of file +}