mirror of
https://github.com/Sevichecc/raycast-akkoma-extension.git
synced 2025-04-30 22:49:30 +08:00
style: fix lint
This commit is contained in:
parent
88700da175
commit
bda1804b6a
5 changed files with 12 additions and 24 deletions
|
@ -15,7 +15,6 @@ export const fetchToken = async (params: URLSearchParams, errorMessage: string):
|
||||||
return (await response.json()) as OAuth.TokenResponse;
|
return (await response.json()) as OAuth.TokenResponse;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
export const createApp = async (): Promise<Credentials> => {
|
export const createApp = async (): Promise<Credentials> => {
|
||||||
const { instance } = getPreferenceValues<Preference>();
|
const { instance } = getPreferenceValues<Preference>();
|
||||||
|
|
||||||
|
@ -37,7 +36,6 @@ export const createApp = async (): Promise<Credentials> => {
|
||||||
return (await response.json()) as Credentials;
|
return (await response.json()) as Credentials;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
export const postNewStatus = async ({
|
export const postNewStatus = async ({
|
||||||
status,
|
status,
|
||||||
visibility,
|
visibility,
|
||||||
|
@ -53,7 +51,7 @@ export const postNewStatus = async ({
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json",
|
"Content-Type": "application/json",
|
||||||
"Authorization": "Bearer " + tokenSet?.accessToken,
|
Authorization: "Bearer " + tokenSet?.accessToken,
|
||||||
},
|
},
|
||||||
body: JSON.stringify({
|
body: JSON.stringify({
|
||||||
status,
|
status,
|
||||||
|
@ -70,7 +68,6 @@ export const postNewStatus = async ({
|
||||||
return (await response.json()) as StatusResponse;
|
return (await response.json()) as StatusResponse;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
export const fetchAccountInfo = async (): Promise<Account> => {
|
export const fetchAccountInfo = async (): Promise<Account> => {
|
||||||
const { instance } = getPreferenceValues<Preference>();
|
const { instance } = getPreferenceValues<Preference>();
|
||||||
const tokenSet = await client.getTokens();
|
const tokenSet = await client.getTokens();
|
||||||
|
@ -78,7 +75,7 @@ export const fetchAccountInfo = async (): Promise<Account> => {
|
||||||
const response = await fetch(`https://${instance}/api/v1/accounts/verify_credentials`, {
|
const response = await fetch(`https://${instance}/api/v1/accounts/verify_credentials`, {
|
||||||
method: "GET",
|
method: "GET",
|
||||||
headers: {
|
headers: {
|
||||||
"Authorization": "Bearer " + tokenSet?.accessToken,
|
Authorization: "Bearer " + tokenSet?.accessToken,
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,5 @@
|
||||||
const Actions = () => {
|
const Actions = () => {
|
||||||
return (
|
return <></>;
|
||||||
<>
|
};
|
||||||
|
|
||||||
</>
|
export default Actions;
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default Actions
|
|
||||||
|
|
|
@ -1,11 +1,7 @@
|
||||||
import { Detail } from "@raycast/api"
|
import { Detail } from "@raycast/api";
|
||||||
|
|
||||||
const StatusPreview = () => {
|
const StatusPreview = () => {
|
||||||
return (
|
return <div></div>;
|
||||||
<div>
|
};
|
||||||
|
|
||||||
</div>
|
export default StatusPreview;
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
export default StatusPreview
|
|
||||||
|
|
|
@ -50,7 +50,7 @@ export const authorize = async (): Promise<void> => {
|
||||||
|
|
||||||
if (tokenSet?.accessToken) {
|
if (tokenSet?.accessToken) {
|
||||||
if (tokenSet.refreshToken && tokenSet.isExpired()) {
|
if (tokenSet.refreshToken && tokenSet.isExpired()) {
|
||||||
LocalStorage.clear()
|
LocalStorage.clear();
|
||||||
const { client_id, client_secret } = await createApp();
|
const { client_id, client_secret } = await createApp();
|
||||||
await client.setTokens(await refreshToken(client_id, client_secret, tokenSet.refreshToken));
|
await client.setTokens(await refreshToken(client_id, client_secret, tokenSet.refreshToken));
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,7 +63,6 @@ export interface Status {
|
||||||
visibility: VisibilityScope;
|
visibility: VisibilityScope;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
export interface StatusResponse {
|
export interface StatusResponse {
|
||||||
id: string;
|
id: string;
|
||||||
create_at: Date;
|
create_at: Date;
|
||||||
|
|
Loading…
Reference in a new issue