remove/disable download options

This commit is contained in:
austinried
2021-08-16 11:05:38 +09:00
parent d72258c68e
commit ad25972774
7 changed files with 84 additions and 62 deletions

View File

@@ -18,6 +18,7 @@ const ImageGradientBackground: React.FC<{
useEffect(() => {
async function getColors() {
console.log(`imagePath: ${imagePath}`)
if (imagePath === undefined) {
return
}
@@ -26,6 +27,7 @@ const ImageGradientBackground: React.FC<{
let res: AndroidImageColors
if (cachedResult) {
console.log(`cachedResult: ${JSON.stringify(cachedResult)}`)
res = cachedResult as AndroidImageColors
} else {
const path = `file://${imagePath}`
@@ -33,12 +35,21 @@ const ImageGradientBackground: React.FC<{
cache: true,
key: imagePath,
})) as AndroidImageColors
console.log(`res: ${JSON.stringify(res)}`)
}
if (res.muted && res.muted !== '#000000') {
setHighColor(res.muted)
} else if (res.darkMuted && res.darkMuted !== '#000000') {
setHighColor(res.darkMuted)
} else if (res.lightMuted && res.lightMuted !== '#000000') {
setHighColor(res.lightMuted)
} else if (res.vibrant && res.vibrant !== '#000000') {
setHighColor(res.vibrant)
} else if (res.darkVibrant && res.darkVibrant !== '#000000') {
setHighColor(res.darkVibrant)
} else if (res.lightVibrant && res.lightVibrant !== '#000000') {
setHighColor(res.lightVibrant)
}
}
getColors()