fix: fix updater not working correctly
Some checks failed
FanslySync Build & Test / FanslySync Test Runner (push) Failing after 23m7s
Some checks failed
FanslySync Build & Test / FanslySync Test Runner (push) Failing after 23m7s
This commit is contained in:
@ -97,9 +97,15 @@
|
||||
);
|
||||
if (uploadErr) {
|
||||
error('[AutoSync] Upload failed');
|
||||
sendNotification({ title: 'Auto Sync Failed', body: `Retry at ${nextTime}` });
|
||||
sendNotification({
|
||||
title: 'Auto Sync Failed',
|
||||
body: `We failed to upload your data. ${uploadErr}. We will try again in ${config.sync_interval} hours.`
|
||||
});
|
||||
} else {
|
||||
sendNotification({ title: 'Auto Sync Successful', body: `Next at ${nextTime}` });
|
||||
sendNotification({
|
||||
title: 'Auto Sync Successful',
|
||||
body: `Your data has been uploaded successfully. Next sync will be at ${nextTime}.`
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -171,7 +177,13 @@
|
||||
|
||||
async function enableAutoSync() {
|
||||
if (!(await isEnabled())) {
|
||||
const confirm = await ask('Enable auto-start?');
|
||||
const confirm = await ask(
|
||||
"We've detected that auto-start is disabled. It's required for auto-sync to work. Do you want to enable it?",
|
||||
{
|
||||
title: 'Auto Sync Setup',
|
||||
kind: 'info'
|
||||
}
|
||||
);
|
||||
if (!confirm) return;
|
||||
await toast.promise(enable(), {
|
||||
loading: 'Enabling...',
|
||||
@ -179,7 +191,11 @@
|
||||
error: 'Failed'
|
||||
});
|
||||
}
|
||||
if (!config?.sync_token) return message('Set a sync token first.', { kind: 'error' });
|
||||
if (!config?.sync_token)
|
||||
return message('Set a sync token first.', {
|
||||
kind: 'error',
|
||||
title: 'Auto Sync Setup | Error'
|
||||
});
|
||||
config!.auto_sync_enabled = !config.auto_sync_enabled;
|
||||
await saveConfig();
|
||||
config.auto_sync_enabled ? scheduleAutoSync() : syncInterval && clearInterval(syncInterval);
|
||||
@ -307,8 +323,8 @@
|
||||
</span>
|
||||
</div>
|
||||
<p class="text-zinc-400 mb-4">
|
||||
We'll automatically sync your data {config?.sync_interval}
|
||||
{config?.sync_interval === 1 ? 'hour' : 'hours'} to your configured discord server.
|
||||
Your data will be automatically synced to your configured Discord server every {config?.sync_interval}
|
||||
{config?.sync_interval === 1 ? 'hour' : 'hours'}
|
||||
</p>
|
||||
<div class="flex space-x-4">
|
||||
<button
|
||||
|
Reference in New Issue
Block a user