diff --git a/src/App.tsx b/src/App.tsx index 3bcface4..49fda414 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -352,6 +352,10 @@ export const App = memo(() => { storage.set("cameraUploadFetchRemoteAssetsTimeout:" + userId, (new Date().getTime() - 5000)) return () => { + setSetupDone(false) + + global.nodeThread.ready = false + dimensionsListener.remove() shareMenuListener.remove() navigationRef.removeListener("state", navigationRefListener) @@ -360,7 +364,7 @@ export const App = memo(() => { netInfoListener() } - }, []) + }, [isLoggedIn]) return ( <> diff --git a/src/components/ActionSheets/ActionSheets.tsx b/src/components/ActionSheets/ActionSheets.tsx index 20189f7b..b2cff6a5 100644 --- a/src/components/ActionSheets/ActionSheets.tsx +++ b/src/components/ActionSheets/ActionSheets.tsx @@ -2130,7 +2130,7 @@ export const FolderColorActionSheet = memo(() => { const [lang, setLang] = useMMKVString("lang", storage) const currentActionSheetItem = useStore(state => state.currentActionSheetItem) const [buttonsDisabled, setButtonsDisabled] = useState(false) - const availableFolderColors: any = getAvailableFolderColors() + const availableFolderColors = getAvailableFolderColors() useEffect(() => { setButtonsDisabled(false) @@ -2159,6 +2159,14 @@ export const FolderColorActionSheet = memo(() => { { Object.keys(availableFolderColors).map((prop) => { + if(prop == "default_ios"){ + return null + } + + if(Platform.OS == "ios" && prop == "blue"){ + return null + } + return ( { showToast({ message: err.toString() }) }) }} - color={availableFolderColors[prop] as string} + color={Platform.OS == "ios" && prop == "default" ? availableFolderColors['default_ios'] as string : availableFolderColors[prop] as string} text={i18n(lang, "color_" + prop)} /> ) diff --git a/src/lib/helpers/helpers.ts b/src/lib/helpers/helpers.ts index 61c12486..cff7ac8b 100644 --- a/src/lib/helpers/helpers.ts +++ b/src/lib/helpers/helpers.ts @@ -84,30 +84,35 @@ export const calcTimeLeft = (loadedBytes: number, totalBytes: number, started: n return remaining > 0 ? remaining : 0 } -export const getFolderColor = memoize((color: string | null | undefined): string => { +export const getFolderColor = (color: string | null | undefined): string => { const colors = getAvailableFolderColors() if(!color){ - return colors['default'] + return Platform.OS == "ios" ? colors['default_ios'] : colors['default'] } if(typeof colors[color] !== "undefined"){ + if(color == "default"){ + return Platform.OS == "ios" ? colors['default_ios'] : colors['default'] + } + return colors[color] } - return colors['default'] -}) + return Platform.OS == "ios" ? colors['default_ios'] : colors['default'] +} -export const getAvailableFolderColors = memoize((): { [key: string]: string } => { +export const getAvailableFolderColors = (): { [key: string]: string } => { return { - "default": "#F6C358", + "default": "#ffd04c", "blue": "#2992E5", "green": "#57A15B", "purple": "#8E3A9D", "red": "#CB2E35", - "gray": "gray" + "gray": "gray", + "default_ios": "#3ea0d5" } -}) +} export const fileAndFolderNameValidation = (name: string): boolean => { const regex = /[<>:"\/\\|?*\x00-\x1F]|^(?:aux|con|clock\$|nul|prn|com[1-9]|lpt[1-9])$/i diff --git a/src/lib/node/node.ts b/src/lib/node/node.ts index b9066687..148ae7f8 100644 --- a/src/lib/node/node.ts +++ b/src/lib/node/node.ts @@ -496,7 +496,7 @@ global.nodeThread = { } nodejs.channel.addListener("message", (message) => { - if(message == "ready" && !global.nodeThread.ready){ + if(message == "ready"){ return global.nodeThread.ready = true }