From 885ad134b3d290b66d51118fcfbcf04139858228 Mon Sep 17 00:00:00 2001 From: Lewis Crichton Date: Fri, 4 Aug 2023 19:10:12 +0100 Subject: fix(cloud): cross-client enabling without proper validation (#1531) --- src/Vencord.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src') diff --git a/src/Vencord.ts b/src/Vencord.ts index a05ec53..508ac50 100644 --- a/src/Vencord.ts +++ b/src/Vencord.ts @@ -27,6 +27,7 @@ export { PlainSettings, Settings }; import "./utils/quickCss"; import "./webpack/patchWebpack"; +import { get as dsGet } from "./api/DataStore"; import { showNotification } from "./api/Notifications"; import { PlainSettings, Settings } from "./api/Settings"; import { patches, PMLogger, startAllPlugins } from "./plugins"; @@ -38,6 +39,22 @@ import { onceReady } from "./webpack"; import { SettingsRouter } from "./webpack/common"; async function syncSettings() { + // pre-check for local shared settings + if ( + Settings.cloud.authenticated && + await dsGet("Vencord_cloudSecret") === null // this has been enabled due to local settings share or some other bug + ) { + // show a notification letting them know and tell them how to fix it + showNotification({ + title: "Cloud Integrations", + body: "We've noticed you have cloud integrations enabled in another client! Due to limitations, you will " + + "need to re-authenticate to continue using them. Click here to go to the settings page to do so!", + color: "var(--yellow-360)", + onClick: () => SettingsRouter.open("VencordCloud") + }); + return; + } + if ( Settings.cloud.settingsSync && // if it's enabled Settings.cloud.authenticated // if cloud integrations are enabled -- cgit