From e84e473de7d003917c0ec331f4d3c99a3b96a3c8 Mon Sep 17 00:00:00 2001 From: thororen1234 <78185467+thororen1234@users.noreply.github.com> Date: Sun, 10 May 2026 20:14:49 -0400 Subject: [PATCH] Streaks: Not Authorized warning --- src/equicordplugins/streaks/index.tsx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/equicordplugins/streaks/index.tsx b/src/equicordplugins/streaks/index.tsx index 1aea227e8..62e97ba6c 100644 --- a/src/equicordplugins/streaks/index.tsx +++ b/src/equicordplugins/streaks/index.tsx @@ -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();