diff --git a/app/components/bar/SideBar.js b/app/components/bar/SideBar.js
index e10f59b..9ad2772 100644
--- a/app/components/bar/SideBar.js
+++ b/app/components/bar/SideBar.js
@@ -5,7 +5,6 @@ import { useSafeAreaInsets } from 'react-native-safe-area-context'
import { ConfigContext } from '~/contexts/config'
import { ThemeContext } from '~/contexts/theme'
-import Player from '~/utils/player'
import pkg from '~/../package.json'
import size from '~/styles/size'
import mainStyles from '~/styles/main'
@@ -17,8 +16,7 @@ const SideBar = ({ state, descriptors, navigation }) => {
return (
- {
Castafiore
Version {pkg.version}
-
+
{state.routes.map((route, index) => {
const options = React.useMemo(() => descriptors[route.key].options, [])
const isFocused = React.useMemo(() => state.index === index, [state.index, index])
diff --git a/app/components/lists/CustomFlat.js b/app/components/lists/CustomFlat.js
index 3a58862..fbae65c 100644
--- a/app/components/lists/CustomFlat.js
+++ b/app/components/lists/CustomFlat.js
@@ -15,13 +15,13 @@ const CustomScroll = ({ data, renderItem, style = { width: '100%' }, contentCont
const goRight = () => {
if (indexScroll.current + 3 >= data.length) indexScroll.current = data.length - 1
else indexScroll.current = indexScroll.current + 3
- refScroll.current.scrollToIndex({ index: indexScroll.current, animated: true, viewOffset: 10 })
+ refScroll.current.scrollToIndex({ index: indexScroll.current, animated: true, viewOffset: 20 })
}
const goLeft = () => {
if (indexScroll.current < 3) indexScroll.current = 0
else indexScroll.current = indexScroll.current - 3
- refScroll.current.scrollToIndex({ index: indexScroll.current, animated: true, viewOffset: 10 })
+ refScroll.current.scrollToIndex({ index: indexScroll.current, animated: true, viewOffset: 20 })
}
// View is necessary to show the scroll helper
@@ -35,7 +35,7 @@ const CustomScroll = ({ data, renderItem, style = { width: '100%' }, contentCont
index}
+ keyExtractor={(item, index) => `${item.id}-${index}`}
renderItem={renderItem}
horizontal={true}
style={style}
diff --git a/app/components/lists/HorizontalAlbums.js b/app/components/lists/HorizontalAlbums.js
index d3bf31f..b02cd77 100644
--- a/app/components/lists/HorizontalAlbums.js
+++ b/app/components/lists/HorizontalAlbums.js
@@ -24,7 +24,6 @@ const HorizontalAlbums = ({ albums, year = false, onPress = () => { } }) => {
renderItem={({ item, index }) => (
([mainStyles.opacity({ pressed }), styles.album])}
- key={item.id}
onLongPress={() => setIndexOptions(index)}
delayLongPress={200}
onPress={() => {
diff --git a/app/components/lists/HorizontalArtists.js b/app/components/lists/HorizontalArtists.js
index 5faf19d..8fb43cf 100644
--- a/app/components/lists/HorizontalArtists.js
+++ b/app/components/lists/HorizontalArtists.js
@@ -24,7 +24,6 @@ const HorizontalArtists = ({ artists, onPress = () => { } }) => {
data={artists}
renderItem={({ item, index }) => (
([mainStyles.opacity({ pressed }), styles.artist])}
onPress={() => {
onPress(item)
diff --git a/app/components/lists/HorizontalGenres.js b/app/components/lists/HorizontalGenres.js
index 17754d0..a8b59c3 100644
--- a/app/components/lists/HorizontalGenres.js
+++ b/app/components/lists/HorizontalGenres.js
@@ -19,7 +19,6 @@ const HorizontalGenres = ({ genres }) => {
renderItem={({ item }) => (
([mainStyles.opacity({ pressed }), styles.genreBox(theme)])}
- key={item?.value}
onPress={() => navigation.navigate('Genre', { genre: item })}>
{item.value}
diff --git a/app/components/settings/HomeOrder.js b/app/components/settings/HomeOrder.js
index 2f59e79..32ff5a6 100644
--- a/app/components/settings/HomeOrder.js
+++ b/app/components/settings/HomeOrder.js
@@ -1,5 +1,5 @@
import React from 'react';
-import { Text, PanResponder, Animated } from 'react-native';
+import { View, Text, PanResponder, Animated, Pressable } from 'react-native';
import Icon from 'react-native-vector-icons/FontAwesome';
import { SettingsContext, SetSettingsContext } from '~/contexts/settings';
@@ -72,22 +72,32 @@ const HomeOrder = () => {
transform: [{ translateY: position }]
}
]}
- {...panResponder.panHandlers}
>
-
- {value.title}
-
-
+ onPressHomeOrder(index)}
+ style={{ flex: 1, height: '100%', flexDirection: 'row', alignItems: 'center' }}
+ >
+
+
+
+ {value.title}
+
+
+
+
+
)
})
}
diff --git a/app/screens/Settings/Informations.js b/app/screens/Settings/Informations.js
index 3225615..54a33c9 100644
--- a/app/screens/Settings/Informations.js
+++ b/app/screens/Settings/Informations.js
@@ -92,7 +92,7 @@ const InformationsSettings = () => {
value={convertDate(scan.lastScan)}
/>
{
title="Informations"
icon="info"
onPress={() => navigation.navigate('Settings/Informations')}
+ />
+ Linking.openURL('https://github.com/sawyerf/Castafiore')}
isLast={true}
/>
@@ -115,12 +120,16 @@ const Settings = ({ navigation }) => {
confirmAlert(
'Reset Settings',
'Are you sure you want to reset all settings?',
- () => setSettings(defaultSettings)
+ () => setSettings({
+ ...defaultSettings,
+ servers: setting.servers
+ })
)
}}
isLast={true}
/>
+
)
}
diff --git a/app/utils/cache.web.js b/app/utils/cache.web.js
index 0b403f7..c3a8480 100644
--- a/app/utils/cache.web.js
+++ b/app/utils/cache.web.js
@@ -5,7 +5,13 @@ export const getCache = async (cacheName, key) => {
}
export const clearCache = async () => {
- const keys = await window.caches.keys()
+ const keys = [
+ 'api',
+ 'coverArt',
+ 'images',
+ 'lyrics',
+ 'song',
+ ]
keys.forEach(async (key) => {
await window.caches.delete(key)
})