mobile: minor fixes

This commit is contained in:
Ammar Ahmed
2024-02-09 10:41:21 +05:00
committed by Abdullah Atta
parent d0f0c32ffa
commit 4ee82b4fd6
2 changed files with 9 additions and 6 deletions

View File

@@ -47,6 +47,7 @@ import { Button } from "../../ui/button";
import Seperator from "../../ui/seperator";
import SheetWrapper from "../../ui/sheet";
import Paragraph from "../../ui/typography/paragraph";
import Navigation from "../../../services/navigation";
const RestoreDataSheet = () => {
const [visible, setVisible] = useState(false);
@@ -242,6 +243,7 @@ const RestoreDataComponent = ({ close, setRestoring, restoring }) => {
const restoreBackup = async (backup, password, key) => {
await db.backup.import(backup, password, key);
await db.initCollections();
initialize();
ToastManager.show({
@@ -249,10 +251,12 @@ const RestoreDataComponent = ({ close, setRestoring, restoring }) => {
type: "success",
context: "global"
});
Navigation.queueRoutesForUpdate();
return true;
};
const backupError = (e) => {
console.log(e.stack);
ToastManager.show({
heading: "Restore failed",
message:
@@ -314,7 +318,7 @@ const RestoreDataComponent = ({ close, setRestoring, restoring }) => {
}
await db.initCollections();
initialize();
Navigation.queueRoutesForUpdate();
setRestoring(false);
close();
ToastManager.show({

View File

@@ -28,12 +28,11 @@ import { useMenuStore } from "../../stores/use-menu-store";
import useNavigationStore from "../../stores/use-navigation-store";
import { useSettingStore } from "../../stores/use-setting-store";
import { SIZE, normalize } from "../../utils/size";
import { presentDialog } from "../dialog/functions";
import ReorderableList from "../list/reorderable-list";
import { Properties } from "../properties";
import { PressableButton } from "../ui/pressable";
import Heading from "../ui/typography/heading";
import Paragraph from "../ui/typography/paragraph";
import ReorderableList from "../list/reorderable-list";
import { Properties } from "../properties";
export const ColorSection = React.memo(
function ColorSection() {
@@ -142,11 +141,11 @@ const ColorItem = React.memo(
</View>
{isFocused ? (
<Heading color={colors.selected.heading} size={SIZE.md}>
{item.title?.slice(0, 1).toUpperCase() + item.title.slice(1)}
{item.title}
</Heading>
) : (
<Paragraph color={colors.primary.paragraph} size={SIZE.md}>
{item.title?.slice(0, 1).toUpperCase() + item.title.slice(1)}
{item.title}
</Paragraph>
)}
</View>