Compare commits

..

2 Commits

Author SHA1 Message Date
Lei Nelissen
c8e693991b chore: release v2.4.4 2025-02-04 22:37:24 +01:00
Lei Nelissen
7a163f4bde fix: android not properly reading redux store file
fixes #265
2025-02-04 22:32:53 +01:00
4 changed files with 19 additions and 6 deletions

View File

@@ -85,8 +85,8 @@ android {
applicationId "nl.moeilijkedingen.jellyfinaudioplayer" applicationId "nl.moeilijkedingen.jellyfinaudioplayer"
minSdkVersion rootProject.ext.minSdkVersion minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 33 versionCode 34
versionName "2.4.3" versionName "2.4.4"
} }
signingConfigs { signingConfigs {

4
package-lock.json generated
View File

@@ -1,12 +1,12 @@
{ {
"name": "fintunes", "name": "fintunes",
"version": "2.4.3", "version": "2.4.4",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "fintunes", "name": "fintunes",
"version": "2.4.3", "version": "2.4.4",
"hasInstallScript": true, "hasInstallScript": true,
"dependencies": { "dependencies": {
"@react-native-async-storage/async-storage": "^1.21.0", "@react-native-async-storage/async-storage": "^1.21.0",

View File

@@ -1,6 +1,6 @@
{ {
"name": "fintunes", "name": "fintunes",
"version": "2.4.3", "version": "2.4.4",
"main": "src/index.js", "main": "src/index.js",
"private": true, "private": true,
"scripts": { "scripts": {

View File

@@ -21,10 +21,23 @@ async function ensureDirectoryExists() {
*/ */
const MigratedStorage: Storage = { const MigratedStorage: Storage = {
async getItem(key) { async getItem(key) {
// Calculate the path where the key should be stored
const path = getFileByKey(key); const path = getFileByKey(key);
// By default, the key for the persistor is "persist:root", which
// contains a special character. We run the key through
// `encodeURIcomponent`, so we don't trigger any special character
// filename errors. However, on Android, react-native-fs doesn't resolve
// the paths properly and fails to find the encoded variant. Hence,
// we'll also "unencode" the variant and check for existence of any of
// the two files.
const storeFileExists = (await Promise.all([
exists(path),
exists(decodeURIComponent(path))
])).some((d) => d === true);
// GUARD: Check whether a store already exists on the filesystem // GUARD: Check whether a store already exists on the filesystem
if (await exists(path)) { if (storeFileExists) {
// In which case, we'll read it from disk // In which case, we'll read it from disk
return readFile(path); return readFile(path);
} else { } else {