Reader hotkeys

This commit is contained in:
schroda
2024-11-03 03:09:00 +01:00
parent 0ae9d9ebb2
commit 0b1c67ce9f
26 changed files with 781 additions and 31 deletions

View File

@@ -93,6 +93,7 @@ const convertSettingsToMetadata = (
readerWidth: JSON.stringify(settings.readerWidth),
profiles: JSON.stringify(settings.profiles),
readingModesDefaultProfile: JSON.stringify(settings.readingModesDefaultProfile),
hotkeys: JSON.stringify(settings.hotkeys),
});
export const DEFAULT_READER_SETTINGS_WITH_DEFAULT_FLAG = convertToSettingsWithDefaultFlag(
@@ -130,6 +131,8 @@ const convertMetadataToSettings = (
profiles.includes(profile) ? profile : DEFAULT_READER_PROFILE,
]),
) as IReaderSettings['readingModesDefaultProfile'],
hotkeys:
jsonSaveParse<IReaderSettings['hotkeys']>((metadata.hotkeys as string) ?? '') ?? defaultSettings.hotkeys,
};
};