fix(kobo-sync): use KoboSpan for progress sync (#253)
This commit is contained in:
+10
@@ -60,6 +60,16 @@
|
||||
<br>
|
||||
<strong>{{ t('kobo.twoWaySyncNote') }}</strong>
|
||||
</p>
|
||||
@if (syncForm.controls.twoWayProgressSync.value && !koboSettings.convertToKepub) {
|
||||
<p class="setting-warning" role="status" aria-live="polite" aria-atomic="true">
|
||||
<i class="pi pi-exclamation-triangle" aria-hidden="true"></i>
|
||||
@if (isAdmin) {
|
||||
{{ t('kobo.twoWaySyncKepubWarningAdmin') }}
|
||||
} @else {
|
||||
{{ t('kobo.twoWaySyncKepubWarning') }}
|
||||
}
|
||||
</p>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
||||
+6
@@ -118,6 +118,12 @@
|
||||
line-height: 1.5;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.setting-warning {
|
||||
@include settings.settings-warning-notice;
|
||||
|
||||
margin-top: 0.75rem;
|
||||
}
|
||||
}
|
||||
|
||||
.setting-control {
|
||||
|
||||
+3
-3
@@ -91,10 +91,10 @@ describe('KoboSyncSettingsComponent', () => {
|
||||
const component = fixture.componentInstance;
|
||||
|
||||
TestBed.flushEffects();
|
||||
expect(component.koboSettings.convertToKepub).toBe(false);
|
||||
expect(component.koboSettings.convertToKepub).toBe(true);
|
||||
|
||||
appSettingsState.set(buildAppSettings({
|
||||
convertToKepub: true,
|
||||
convertToKepub: false,
|
||||
conversionLimitInMb: 42,
|
||||
convertCbxToEpub: true,
|
||||
conversionImageCompressionPercentage: 73,
|
||||
@@ -106,7 +106,7 @@ describe('KoboSyncSettingsComponent', () => {
|
||||
TestBed.flushEffects();
|
||||
|
||||
expect(component.koboSettings).toEqual({
|
||||
convertToKepub: true,
|
||||
convertToKepub: false,
|
||||
conversionLimitInMb: 42,
|
||||
convertCbxToEpub: true,
|
||||
conversionImageCompressionPercentage: 73,
|
||||
|
||||
+11
-1
@@ -58,7 +58,7 @@ export class KoboSyncSettingsComponent implements OnInit {
|
||||
});
|
||||
|
||||
koboSettings: KoboSettings = {
|
||||
convertToKepub: false,
|
||||
convertToKepub: true,
|
||||
conversionLimitInMb: 100,
|
||||
convertCbxToEpub: false,
|
||||
conversionImageCompressionPercentage: 85,
|
||||
@@ -110,6 +110,16 @@ export class KoboSyncSettingsComponent implements OnInit {
|
||||
|
||||
protected hasHydratedKoboAdmin = false;
|
||||
|
||||
private readonly syncKepubSettingEffect = effect(() => {
|
||||
const user = this.userService.currentUser();
|
||||
const settings = this.appSettingsService.appSettings();
|
||||
if (!user?.permissions.canSyncKobo || !settings) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.koboSettings.convertToKepub = settings.koboSettings?.convertToKepub ?? true;
|
||||
});
|
||||
|
||||
private readonly syncAdminSettingsEffect = effect(() => {
|
||||
const user = this.userService.currentUser();
|
||||
const settings = this.appSettingsService.appSettings();
|
||||
|
||||
Reference in New Issue
Block a user