aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Cao <70191398+ryanccn@users.noreply.github.com>2023-07-04 23:59:42 +0800
committerGitHub <noreply@github.com>2023-07-04 15:59:42 +0000
commit232e340fab83757bc3ed023560236b1fb576c3cc (patch)
tree8fb37b3b585b8fe4dbec694b07acbdc86037e8a1
parent8027daa2b0fcb00a99328b9ba02d06668e4688f9 (diff)
downloadVencord-232e340fab83757bc3ed023560236b1fb576c3cc.tar.gz
Vencord-232e340fab83757bc3ed023560236b1fb576c3cc.tar.bz2
Vencord-232e340fab83757bc3ed023560236b1fb576c3cc.zip
fix: send notification when settings are manually synced (#1378)
Co-authored-by: V <vendicated@riseup.net>
-rw-r--r--src/components/VencordSettings/CloudTab.tsx2
-rw-r--r--src/utils/settingsSync.ts10
2 files changed, 10 insertions, 2 deletions
diff --git a/src/components/VencordSettings/CloudTab.tsx b/src/components/VencordSettings/CloudTab.tsx
index 77e5298..0392a45 100644
--- a/src/components/VencordSettings/CloudTab.tsx
+++ b/src/components/VencordSettings/CloudTab.tsx
@@ -86,7 +86,7 @@ function SettingsSyncSection() {
<Button
size={Button.Sizes.SMALL}
disabled={!sectionEnabled}
- onClick={() => putCloudSettings()}
+ onClick={() => putCloudSettings(true)}
>Sync to Cloud</Button>
<Tooltip text="This will overwrite your local settings with the ones on the cloud. Use wisely!">
{({ onMouseLeave, onMouseEnter }) => (
diff --git a/src/utils/settingsSync.ts b/src/utils/settingsSync.ts
index 850d45f..72c876f 100644
--- a/src/utils/settingsSync.ts
+++ b/src/utils/settingsSync.ts
@@ -121,7 +121,7 @@ export async function uploadSettingsBackup(showToast = true): Promise<void> {
// Cloud settings
const cloudSettingsLogger = new Logger("Cloud:Settings", "#39b7e0");
-export async function putCloudSettings() {
+export async function putCloudSettings(manual?: boolean) {
const settings = await exportSettings({ minify: true });
try {
@@ -149,6 +149,14 @@ export async function putCloudSettings() {
VencordNative.settings.set(JSON.stringify(PlainSettings, null, 4));
cloudSettingsLogger.info("Settings uploaded to cloud successfully");
+
+ if (manual) {
+ showNotification({
+ title: "Cloud Settings",
+ body: "Synchronized settings to the cloud!",
+ noPersist: true,
+ });
+ }
} catch (e: any) {
cloudSettingsLogger.error("Failed to sync up", e);
showNotification({