mirror of
https://github.com/streetwriters/notesnook.git
synced 2026-02-24 04:00:59 +01:00
mobile: fix trash cleanup interval text
This commit is contained in:
@@ -48,7 +48,7 @@ const onPressFloatingButton = () => {
|
||||
positivePress: async () => {
|
||||
await db.trash?.clear();
|
||||
useTrashStore.getState().setTrash();
|
||||
useSelectionStore.getState().clearSelection(true);
|
||||
useSelectionStore.getState().clearSelection();
|
||||
ToastEvent.show({
|
||||
heading: "Trash cleared",
|
||||
message:
|
||||
@@ -60,13 +60,15 @@ const onPressFloatingButton = () => {
|
||||
positiveType: "errorShade"
|
||||
});
|
||||
};
|
||||
|
||||
const PLACEHOLDER_DATA = {
|
||||
const PLACEHOLDER_DATA = (trashCleanupInterval = 7) => ({
|
||||
heading: "Trash",
|
||||
paragraph: "Items in the trash will be permanently deleted after 7 days.",
|
||||
paragraph:
|
||||
trashCleanupInterval === -1
|
||||
? "Set automatic trash cleanup interval from Settings > Behaviour > Clean trash interval."
|
||||
: `Items in the trash will be permanently deleted after after ${trashCleanupInterval} days.`,
|
||||
button: null,
|
||||
loading: "Loading trash items"
|
||||
};
|
||||
});
|
||||
|
||||
export const Trash = ({ navigation, route }: NavigationProps<"Trash">) => {
|
||||
const trash = useTrashStore((state) => state.trash);
|
||||
@@ -95,7 +97,9 @@ export const Trash = ({ navigation, route }: NavigationProps<"Trash">) => {
|
||||
type="trash"
|
||||
screen="Trash"
|
||||
loading={!isFocused}
|
||||
placeholderData={PLACEHOLDER_DATA}
|
||||
placeholderData={PLACEHOLDER_DATA(
|
||||
db.settings?.getTrashCleanupInterval()
|
||||
)}
|
||||
headerProps={{
|
||||
heading: "Trash",
|
||||
color: null
|
||||
|
||||
Reference in New Issue
Block a user