aboutsummaryrefslogtreecommitdiff
path: root/src/plugins/reviewDB/settings.tsx
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/reviewDB/settings.tsx')
-rw-r--r--src/plugins/reviewDB/settings.tsx12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/plugins/reviewDB/settings.tsx b/src/plugins/reviewDB/settings.tsx
index e318bc7..cf61a38 100644
--- a/src/plugins/reviewDB/settings.tsx
+++ b/src/plugins/reviewDB/settings.tsx
@@ -20,8 +20,7 @@ import { definePluginSettings } from "@api/Settings";
import { OptionType } from "@utils/types";
import { Button } from "@webpack/common";
-import { ReviewDBUser } from "./entities";
-import { authorize } from "./utils";
+import { authorize, getToken } from "./auth";
export const settings = definePluginSettings({
authorize: {
@@ -57,10 +56,11 @@ export const settings = definePluginSettings({
type: OptionType.COMPONENT,
description: "ReviewDB website",
component: () => (
- <Button onClick={() => {
+ <Button onClick={async () => {
let url = "https://reviewdb.mantikafasi.dev/";
- if (settings.store.token)
- url += "/api/redirect?token=" + encodeURIComponent(settings.store.token);
+ const token = await getToken();
+ if (token)
+ url += "/api/redirect?token=" + encodeURIComponent(token);
VencordNative.native.openExternal(url);
}}>
@@ -80,8 +80,6 @@ export const settings = definePluginSettings({
)
}
}).withPrivateSettings<{
- token?: string;
- user?: ReviewDBUser;
lastReviewId?: number;
reviewsDropdownState?: boolean;
}>();