A fully open source & end-to-end encrypted note taking alternative to Evernote.
TypeScript asp-net-coredotnet-coreelectronfosshacktoberfestnote-managmentnote-takingnote-taking-appnotebooknotesnotes-appopen-sourceopensourceprivacyproductivityreactreact-nativereactjsself-hosted
mobile: fix loading indicator causes cancel button to jump
Ammar Ahmedd4d7eac2403c
diff --git a/apps/mobile/app/components/dialog/dialog-buttons.tsx b/apps/mobile/app/components/dialog/dialog-buttons.tsxindex fd055abfd..01e8d1efb 100644--- a/apps/mobile/app/components/dialog/dialog-buttons.tsx+++ b/apps/mobile/app/components/dialog/dialog-buttons.tsx@@ -20,7 +20,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.import { strings } from "@notesnook/intl";import { useThemeColors } from "@notesnook/theme";import React from "react";-import { StyleSheet, View } from "react-native";+import { ActivityIndicator, StyleSheet, View } from "react-native";import Icon from "react-native-vector-icons/MaterialCommunityIcons";import { notesnook } from "../../../e2e/test.ids";import { getColorLinearShade } from "../../utils/colors";@@ -79,6 +79,11 @@ const DialogButtons = ({/><Paragraph color={colors.primary.accent}>{" " + doneText}</Paragraph></View>+ ) : loading ? (+ <ActivityIndicator+ size={AppFontSize.lg}+ color={colors.primary.accent}+ />) : (<View />)}@@ -105,7 +110,6 @@ const DialogButtons = ({style={{marginLeft: 10}}- loading={loading}boldtype={positiveType || "transparent"}title={positiveTitle}diff --git a/apps/mobile/app/components/dialog/index.tsx b/apps/mobile/app/components/dialog/index.tsxindex b3ebd16d3..c4e6a1080 100644--- a/apps/mobile/app/components/dialog/index.tsx+++ b/apps/mobile/app/components/dialog/index.tsx@@ -67,15 +67,13 @@ export const Dialog = ({ context = "global" }: { context?: string }) => {// Handle form submission if form is availableif (dialogInfo?.form && formRef.current) {inputRef.current?.blur();- setLoading(true);try {const isValid = await formRef.current.validate();if (!isValid) {- setLoading(false);return;}-if (dialogInfo.form.onFormSubmit) {+ setLoading(true);const result = await dialogInfo.form.onFormSubmit(formRef.current);if (result === false) {setLoading(false);