feat: recently added notifications

This commit is contained in:
Fredrik Burmester
2025-02-20 15:08:14 +01:00
parent ff35559687
commit 63ea7d128f
8 changed files with 250 additions and 6 deletions

View File

@@ -53,7 +53,7 @@ type MediaListSection = {
type Section = ScrollingCollectionListSection | MediaListSection;
export const SettingsIndex = () => {
export const HomeIndex = () => {
const router = useRouter();
const { t } = useTranslation();

View File

@@ -164,6 +164,7 @@ export const OtherSettings: React.FC = () => {
title={t("home.settings.other.hide_libraries")}
showArrow
/>
<ListItem
title={t("home.settings.other.default_quality")}
disabled={pluginSettings?.defaultBitrate?.locked}
@@ -173,7 +174,6 @@ export const OtherSettings: React.FC = () => {
disabled={pluginSettings?.defaultBitrate?.locked}
keyExtractor={(item) => item.key}
titleExtractor={(item) => item.key}
selected={settings.defaultBitrate}
title={
<TouchableOpacity className="flex flex-row items-center justify-between py-3 pl-3">
<Text className="mr-1 text-[#8E8D91]">
@@ -202,6 +202,14 @@ export const OtherSettings: React.FC = () => {
}
/>
</ListItem>
<ListItem title={"Recently added notifications"}>
<Switch
value={settings.recentlyAddedNotifications}
onValueChange={(recentlyAddedNotifications) =>
updateSettings({ recentlyAddedNotifications })
}
/>
</ListItem>
</ListGroup>
</DisabledSetting>
);

View File

@@ -8,6 +8,8 @@ import { toast } from "sonner-native";
import { ListGroup } from "../list/ListGroup";
import { ListItem } from "../list/ListItem";
import { useTranslation } from "react-i18next";
import { storage } from "@/utils/mmkv";
import { RECENTLY_ADDED_SENT_NOTIFICATIONS_ITEM_IDS_KEY } from "@/utils/recently-added-notifications";
export const StorageSettings = () => {
const { deleteAllFiles, appSizeUsage } = useDownload();
@@ -109,6 +111,15 @@ export const StorageSettings = () => {
title={t("home.settings.storage.delete_all_downloaded_files")}
/>
</ListGroup>
<ListGroup>
<ListItem
textColor="red"
onPress={() => {
storage.set(RECENTLY_ADDED_SENT_NOTIFICATIONS_ITEM_IDS_KEY, "[]");
}}
title={"Reset recently added notifications"}
/>
</ListGroup>
</View>
);
};