mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2025-01-07 02:11:11 +03:00
Fix persisting cloud sync setting
This commit is contained in:
parent
ef0f69eb55
commit
9a3d458e30
@ -29,12 +29,8 @@
|
|||||||
dispatch('updated', { ...project, api: { ...cloudProject, sync: project.api.sync } });
|
dispatch('updated', { ...project, api: { ...cloudProject, sync: project.api.sync } });
|
||||||
});
|
});
|
||||||
|
|
||||||
const onSyncChange = async (event: Event) => {
|
const onSyncChange = async (event: CustomEvent<boolean>) => {
|
||||||
if (!user) return;
|
if (!user) return;
|
||||||
|
|
||||||
const target = event.target as HTMLInputElement;
|
|
||||||
const sync = target.checked;
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const cloudProject =
|
const cloudProject =
|
||||||
project.api ??
|
project.api ??
|
||||||
@ -43,7 +39,7 @@
|
|||||||
description: project.description,
|
description: project.description,
|
||||||
uid: project.id
|
uid: project.id
|
||||||
}));
|
}));
|
||||||
dispatch('updated', { ...project, api: { ...cloudProject, sync } });
|
dispatch('updated', { ...project, api: { ...cloudProject, sync: event.detail } });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(`Failed to update project sync status: ${error}`);
|
console.error(`Failed to update project sync status: ${error}`);
|
||||||
toasts.error('Failed to update project sync status');
|
toasts.error('Failed to update project sync status');
|
||||||
@ -63,18 +59,16 @@
|
|||||||
class="flex flex-row items-center justify-between rounded-lg border border-light-400 p-2 dark:border-dark-500"
|
class="flex flex-row items-center justify-between rounded-lg border border-light-400 p-2 dark:border-dark-500"
|
||||||
>
|
>
|
||||||
<div class="flex flex-row space-x-3">
|
<div class="flex flex-row space-x-3">
|
||||||
<div class="flex flex-row">
|
<div class="flex flex-row items-center gap-x-1">
|
||||||
<form class="flex items-center gap-1">
|
<Checkbox
|
||||||
<Checkbox
|
name="sync"
|
||||||
name="sync"
|
disabled={user === undefined}
|
||||||
disabled={user === undefined}
|
checked={$aiGenEnabled}
|
||||||
checked={$aiGenEnabled}
|
on:change={() => {
|
||||||
on:change={() => {
|
$aiGenEnabled = !$aiGenEnabled;
|
||||||
$aiGenEnabled = !$aiGenEnabled;
|
}}
|
||||||
}}
|
/>
|
||||||
/>
|
<label class="ml-2" for="sync">Enable branch and commit message generation.</label>
|
||||||
<label class="ml-2" for="sync">Enable branch and commit message generation.</label>
|
|
||||||
</form>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -86,18 +80,16 @@
|
|||||||
class="flex flex-row items-center justify-between rounded-lg border border-light-400 p-2 dark:border-dark-500"
|
class="flex flex-row items-center justify-between rounded-lg border border-light-400 p-2 dark:border-dark-500"
|
||||||
>
|
>
|
||||||
<div class="flex flex-row space-x-3">
|
<div class="flex flex-row space-x-3">
|
||||||
<div class="flex flex-row">
|
<div class="flex flex-row items-center gap-1">
|
||||||
<form class="flex items-center gap-1">
|
<Checkbox
|
||||||
<Checkbox
|
name="sync"
|
||||||
name="sync"
|
disabled={user === undefined}
|
||||||
disabled={user === undefined}
|
checked={project.api?.sync || false}
|
||||||
checked={project.api?.sync || false}
|
on:change={onSyncChange}
|
||||||
on:change={onSyncChange}
|
/>
|
||||||
/>
|
<label class="ml-2" for="sync">
|
||||||
<label class="ml-2" for="sync">
|
Sync my history, repository and branch data for backup, sharing and team features.
|
||||||
Sync my history, repository and branch data for backup, sharing and team features.
|
</label>
|
||||||
</label>
|
|
||||||
</form>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user