Streaks: Not Authorized warning
This commit is contained in:
parent
7f8e89412e
commit
e84e473de7
1 changed files with 16 additions and 0 deletions
|
|
@ -7,7 +7,9 @@
|
|||
import "./style.css";
|
||||
|
||||
import { DecoratorProps } from "@api/MemberListDecorators";
|
||||
import { showNotification } from "@api/Notifications";
|
||||
import { iconsModule } from "@equicordplugins/_core/concatenatedModules";
|
||||
import { authorize } from "@plugins/reviewDB/auth";
|
||||
import { Devs, EquicordDevs } from "@utils/constants";
|
||||
import { classNameFactory } from "@utils/css";
|
||||
import definePlugin from "@utils/types";
|
||||
|
|
@ -71,6 +73,20 @@ export default definePlugin({
|
|||
dependencies: ["MessageDecorationsAPI", "MemberListDecoratorsAPI", "ConcatenatedModules"],
|
||||
settings,
|
||||
|
||||
start() {
|
||||
if (!useAuthorizationStore.getState().isAuthorized()) {
|
||||
showNotification({
|
||||
title: "Not Authorized To Use Streaks",
|
||||
body: "Please click here to authorize",
|
||||
async onClick() {
|
||||
await authorize();
|
||||
await useStreaksStore.getState().migrate();
|
||||
await useStreaksStore.getState().fetch();
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
flux: {
|
||||
async CONNECTION_OPEN() {
|
||||
useAuthorizationStore.getState().init();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue