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 share extension in release
Ammar Ahmed29f66d457db0
diff --git a/apps/mobile/app/hooks/use-app-events.tsx b/apps/mobile/app/hooks/use-app-events.tsxindex d88b3ddbc..354094ffc 100644--- a/apps/mobile/app/hooks/use-app-events.tsx+++ b/apps/mobile/app/hooks/use-app-events.tsx@@ -628,7 +628,7 @@ export const useAppEvents = () => {if (!db.isInitialized) {await db.init();}- initialize();+ await initialize();useNoteStore.getState().setLoading(false);},disableClosing: true@@ -658,7 +658,9 @@ export const useAppEvents = () => {}if (IsDatabaseMigrationRequired()) return;initialize();- useNoteStore.getState().setLoading(false);+ setImmediate(() => {+ useNoteStore.getState().setLoading(false);+ });Walkthrough.init();} catch (e) {DatabaseLogger.error(e as Error);diff --git a/apps/mobile/app/navigation/navigation-stack.js b/apps/mobile/app/navigation/navigation-stack.jsindex 40bc89fa1..741a72c5b 100644--- a/apps/mobile/app/navigation/navigation-stack.js+++ b/apps/mobile/app/navigation/navigation-stack.js@@ -81,7 +81,6 @@ const _Tabs = () => {(state) => state.settings.introCompleted);const height = useSettingStore((state) => state.dimensions.height);- const loading = useNoteStore((state) => state.loading);const insets = useGlobalSafeAreaInsets();const screenHeight = height - (50 + insets.top + insets.bottom);React.useEffect(() => {@@ -90,18 +89,7 @@ const _Tabs = () => {}, 1000);}, [homepage]);- return loading && introCompleted ? (- <>- <SafeAreaView- style={{- flex: 1,- backgroundColor: colors.primary.background- }}- >- <DelayLayout animated={false} wait={loading} />- </SafeAreaView>- </>- ) : (+ return (<NativeStack.NavigatortabBar={() => null}initialRouteName={!introCompleted ? "Welcome" : homepage}diff --git a/apps/mobile/app/stores/index.ts b/apps/mobile/app/stores/index.tsindex 6f7b31342..31102bce5 100644--- a/apps/mobile/app/stores/index.ts+++ b/apps/mobile/app/stores/index.ts@@ -38,19 +38,17 @@ export function initAfterSync() {useRelationStore.getState().update();}-export function initialize() {+export async function initialize() {if (!db) return;- setImmediate(() => {- useMenuStore.getState().setColorNotes();- useMenuStore.getState().setMenuPins();- useNotebookStore.getState().setNotebooks();- useTrashStore.getState().setTrash();- useTagStore.getState().setTags();- useFavoriteStore.getState().setFavorites();- useNoteStore.getState().setNotes();- useReminderStore.getState().setReminders();- Notifications.setupReminders();- });+ useMenuStore.getState().setColorNotes();+ useMenuStore.getState().setMenuPins();+ useNotebookStore.getState().setNotebooks();+ useTrashStore.getState().setTrash();+ useTagStore.getState().setTags();+ useFavoriteStore.getState().setFavorites();+ await useNoteStore.getState().setNotes();+ useReminderStore.getState().setReminders();+ Notifications.setupReminders();}export function clearAllStores() {diff --git a/apps/mobile/app/utils/tooltip.ts b/apps/mobile/app/utils/tooltip.tsindex 586d304d5..86d122043 100644--- a/apps/mobile/app/utils/tooltip.ts+++ b/apps/mobile/app/utils/tooltip.ts@@ -16,8 +16,6 @@ GNU General Public License for more details.You should have received a copy of the GNU General Public Licensealong with this program. If not, see <http://www.gnu.org/licenses/>.*/-import RNTooltips from "react-native-tooltips";-import { tabBarRef } from "./global-refs";import { Platform } from "react-native";export const POSITIONS = {@@ -26,9 +24,13 @@ export const POSITIONS = {TOP: 3,BOTTOM: 4};-+let RNTooltips: any;let prevTarget: any = null;function show(event: any, text: string, position = 2) {+ const tabBarRef = require("./global-refs").tabBarRef;+ if (!RNTooltips) {+ RNTooltips = require("react-native-tooltips").default;+ }if (!event._targetInst?.ref?.current) return;prevTarget && RNTooltips.Dismiss(prevTarget);prevTarget = null;diff --git a/apps/mobile/native/index.js b/apps/mobile/native/index.jsindex f4c376a82..c3cfdb995 100644--- a/apps/mobile/native/index.js+++ b/apps/mobile/native/index.js@@ -31,9 +31,6 @@ if (__DEV__) {console.warn = () => null;LogBox.ignoreAllLogs();}-let NotesnookShare;--let QuickNoteIOS;const AppProvider = () => {const App = require('../app/app').default;@@ -43,7 +40,7 @@ const AppProvider = () => {AppRegistry.registerComponent(appName, () => AppProvider);const ShareProvider = () => {- NotesnookShare = require('../share/index').default;+ let NotesnookShare = require('../share/index').default;return Platform.OS === 'ios' ? (<SafeAreaProvider><NotesnookShare quicknote={false} />diff --git a/apps/mobile/native/ios/Make Note/Info.plist b/apps/mobile/native/ios/Make Note/Info.plistindex c0bbbd442..082dc7055 100644--- a/apps/mobile/native/ios/Make Note/Info.plist+++ b/apps/mobile/native/ios/Make Note/Info.plist@@ -52,6 +52,8 @@<key>NSExtensionPointIdentifier</key><string>com.apple.share-services</string></dict>+ <key>ReactNativeQuickSQLite_AppGroup</key>+ <string>group.org.streetwriters.notesnook</string><key>UIAppFonts</key><array><string>OpenSans-Bold.ttf</string>diff --git a/apps/mobile/native/ios/Notesnook.xcodeproj/project.pbxproj b/apps/mobile/native/ios/Notesnook.xcodeproj/project.pbxprojindex 7edda4442..db8da4551 100644--- a/apps/mobile/native/ios/Notesnook.xcodeproj/project.pbxproj+++ b/apps/mobile/native/ios/Notesnook.xcodeproj/project.pbxproj@@ -20,6 +20,9 @@6517B7C22B6838EB0079FF37 /* OpenSans-SemiBold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 6517B7BF2B6838EB0079FF37 /* OpenSans-SemiBold.ttf */; };6517B7C32B6838EB0079FF37 /* OpenSans-Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 6517B7C02B6838EB0079FF37 /* OpenSans-Bold.ttf */; };6529A13E279BC4C70048D4A8 /* BootSplash.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6529A13D279BC4C70048D4A8 /* BootSplash.storyboard */; };+ 656DD2AB2B1891DF00A362EA /* OpenSans-Regular.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 6552012F27019F7700A43C51 /* OpenSans-Regular.ttf */; };+ 656DD2AC2B1891DF00A362EA /* OpenSans-Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 659670B12A2754FD00C5D2AF /* OpenSans-Bold.ttf */; };+ 656DD2AD2B1891DF00A362EA /* OpenSans-SemiBold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 6552012E27019F6E00A43C51 /* OpenSans-SemiBold.ttf */; };6593E4A3281C345400492C50 /* AppDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6593E4A2281C345400492C50 /* AppDelegate.mm */; };659BE46725E11A5100E05671 /* notesnook-text.png in Resources */ = {isa = PBXBuildFile; fileRef = 659BE46625E11A5100E05671 /* notesnook-text.png */; };65AA857925E6DDEC00772A01 /* WidgetKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 65AA857825E6DDEC00772A01 /* WidgetKit.framework */; };@@ -579,6 +582,9 @@isa = PBXResourcesBuildPhase;buildActionMask = 2147483647;files = (+ 656DD2AB2B1891DF00A362EA /* OpenSans-Regular.ttf in Resources */,+ 656DD2AC2B1891DF00A362EA /* OpenSans-Bold.ttf in Resources */,+ 656DD2AD2B1891DF00A362EA /* OpenSans-SemiBold.ttf in Resources */,65C400DF2A80B6B600AA3DF5 /* MaterialCommunityIcons.ttf in Resources */,65C149872A61151B005C40F1 /* extension.bundle in Resources */,65B5014725A672B200E2D264 /* MainInterface.storyboard in Resources */,@@ -1186,7 +1192,6 @@PRODUCT_BUNDLE_IDENTIFIER = org.streetwriters.notesnook;PRODUCT_NAME = Notesnook;PROVISIONING_PROFILE_SPECIFIER = "";- "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Notesnook App Distribution 2024";SWIFT_OBJC_BRIDGING_HEADER = "Notesnook-Bridging-Header.h";SWIFT_VERSION = 5.0;TARGETED_DEVICE_FAMILY = "1,2";@@ -1375,13 +1380,11 @@CLANG_WARN_QUOTED_INCLUDE_IN_FRAMEWORK_HEADER = YES;CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;CODE_SIGN_IDENTITY = "Apple Development";- "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";- CODE_SIGN_STYLE = Manual;+ CODE_SIGN_STYLE = Automatic;COPY_PHASE_STRIP = NO;CURRENT_PROJECT_VERSION = 2076;DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";- DEVELOPMENT_TEAM = "";- "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 53CWBG3QUC;+ DEVELOPMENT_TEAM = 53CWBG3QUC;"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;GCC_C_LANGUAGE_STANDARD = gnu11;INFOPLIST_FILE = NotesWidget/Info.plist;@@ -1396,7 +1399,6 @@PRODUCT_BUNDLE_IDENTIFIER = org.streetwriters.notesnook.notewidget;PRODUCT_NAME = "$(TARGET_NAME)";PROVISIONING_PROFILE_SPECIFIER = "";- "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Notesnook Widget Distribution 2024";SKIP_INSTALL = YES;SWIFT_COMPILATION_MODE = wholemodule;SWIFT_OPTIMIZATION_LEVEL = "-O";@@ -1523,13 +1525,11 @@CLANG_WARN_UNGUARDED_AVAILABILITY = YES_AGGRESSIVE;CODE_SIGN_ENTITLEMENTS = "Make Note/Make Note.entitlements";CODE_SIGN_IDENTITY = "Apple Development";- "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";- CODE_SIGN_STYLE = Manual;+ CODE_SIGN_STYLE = Automatic;COPY_PHASE_STRIP = NO;CURRENT_PROJECT_VERSION = 2076;DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";- DEVELOPMENT_TEAM = "";- "DEVELOPMENT_TEAM[sdk=iphoneos*]" = 53CWBG3QUC;+ DEVELOPMENT_TEAM = 53CWBG3QUC;"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;GCC_C_LANGUAGE_STANDARD = gnu11;HEADER_SEARCH_PATHS = (@@ -1606,7 +1606,6 @@PRODUCT_BUNDLE_IDENTIFIER = org.streetwriters.notesnook.share;PRODUCT_NAME = "$(TARGET_NAME)";PROVISIONING_PROFILE_SPECIFIER = "";- "PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "Notesnook Share Distribution 2024";SKIP_INSTALL = YES;SWIFT_OBJC_BRIDGING_HEADER = "Make Note/Make Note-Bridging-Header.h";SWIFT_VERSION = 5.0;diff --git a/apps/mobile/native/ios/Notesnook.xcodeproj/xcshareddata/xcschemes/Make Note.xcscheme b/apps/mobile/native/ios/Notesnook.xcodeproj/xcshareddata/xcschemes/Make Note.xcschemeindex 146f25b2f..5b133e10c 100644--- a/apps/mobile/native/ios/Notesnook.xcodeproj/xcshareddata/xcschemes/Make Note.xcscheme+++ b/apps/mobile/native/ios/Notesnook.xcodeproj/xcshareddata/xcschemes/Make Note.xcscheme@@ -71,6 +71,11 @@debugServiceExtension = "internal"allowLocationSimulation = "YES"launchAutomaticallySubstyle = "2">+ <RemoteRunnable+ runnableDebuggingMode = "1"+ BundleIdentifier = "com.apple.mobilesafari"+ RemotePath = "/Applications/MobileSafari.app">+ </RemoteRunnable><MacroExpansion><BuildableReferenceBuildableIdentifier = "primary"diff --git a/apps/mobile/native/ios/Notesnook/Info.plist b/apps/mobile/native/ios/Notesnook/Info.plistindex cc044668f..9af8b097b 100644--- a/apps/mobile/native/ios/Notesnook/Info.plist+++ b/apps/mobile/native/ios/Notesnook/Info.plist@@ -88,6 +88,8 @@<string>Only required by library- not requested in application</string><key>NSPhotoLibraryUsageDescription</key><string>Add photos from gallery to your note.</string>+ <key>ReactNativeQuickSQLite_AppGroup</key>+ <string>group.org.streetwriters.notesnook</string><key>UIAppFonts</key><array><string>OpenSans-SemiBold.ttf</string>diff --git a/apps/mobile/native/ios/Podfile b/apps/mobile/native/ios/Podfileindex 635872259..55d2b6b88 100644--- a/apps/mobile/native/ios/Podfile+++ b/apps/mobile/native/ios/Podfile@@ -95,6 +95,9 @@ target 'Make Note' dopod 'callstack-repack', :path => '../../node_modules/@callstack/repack'pod 'RNSecureRandom', :path => '../../node_modules/react-native-securerandom'pod "RNCClipboard", :path => '../../node_modules/@react-native-clipboard/clipboard'+ pod "react-native-quick-sqlite", :path => '../../node_modules/react-native-quick-sqlite'+ pod "RNDeviceInfo", :path => '../../node_modules/react-native-device-info'+ pod "RNPrivacySnapshot", :path => '../../node_modules/react-native-privacy-snapshot'enddiff --git a/apps/mobile/native/ios/Podfile.lock b/apps/mobile/native/ios/Podfile.lockindex 2b0205e6d..3584324a1 100644--- a/apps/mobile/native/ios/Podfile.lock+++ b/apps/mobile/native/ios/Podfile.lock@@ -339,6 +339,10 @@ PODS:- React- react-native-pdf (6.6.2):- React-Core+ - react-native-quick-sqlite (8.0.6):+ - React+ - React-callinvoker+ - React-Core- react-native-safe-area-context (4.6.3):- RCT-Folly- RCTRequired@@ -591,6 +595,7 @@ DEPENDENCIES:- react-native-notification-sounds (from `../../node_modules/react-native-notification-sounds`)- react-native-orientation (from `../../node_modules/react-native-orientation`)- react-native-pdf (from `../../node_modules/react-native-pdf`)+ - react-native-quick-sqlite (from `../../node_modules/react-native-quick-sqlite`)- react-native-safe-area-context (from `../../node_modules/react-native-safe-area-context`)- "react-native-share-extension (from `../../node_modules/@ammarahmed/react-native-share-extension`)"- "react-native-sodium (from `../../node_modules/@ammarahmed/react-native-sodium`)"@@ -734,6 +739,8 @@ EXTERNAL SOURCES::path: "../../node_modules/react-native-orientation"react-native-pdf::path: "../../node_modules/react-native-pdf"+ react-native-quick-sqlite:+ :path: "../../node_modules/react-native-quick-sqlite"react-native-safe-area-context::path: "../../node_modules/react-native-safe-area-context"react-native-share-extension:@@ -880,6 +887,7 @@ SPEC CHECKSUMS:react-native-notification-sounds: da78c828fe1bcbb92d8b505d5261890ed315ff39react-native-orientation: f1caf84d65f1a4fd4511a18f2b924e634ad7a628react-native-pdf: 33c622cbdf776a649929e8b9d1ce2d313347c4fa+ react-native-quick-sqlite: e0e23b749382a85e4b57146f753de737a6c3a9e1react-native-safe-area-context: 36cc67648134e89465663b8172336a19eeda493dreact-native-share-extension: df66a2ee48a62277d79898375e2142bde0782063react-native-sodium: 955bb0dc3ea05f8ea06d5e96cb89d1be7b5d7681@@ -929,6 +937,6 @@ SPEC CHECKSUMS:toolbar-android: 2a73856e98b750d7e71ce4644d3f41cc98211719Yoga: 1d6727ed193122f6adaf435c3de1a768326ff83b-PODFILE CHECKSUM: b0cadd188aa428b98d1eaa0b84b3b6208e714119+PODFILE CHECKSUM: 21553b7e17c48c3fa8e56d4cc26e0c4bd4a74260COCOAPODS: 1.14.2diff --git a/apps/mobile/patches/recyclerlistview+4.2.0.patch b/apps/mobile/patches/recyclerlistview+4.2.0.patchnew file mode 100644index 000000000..d134e89d5--- /dev/null+++ b/apps/mobile/patches/recyclerlistview+4.2.0.patch@@ -0,0 +1,13 @@+diff --git a/node_modules/recyclerlistview/dist/reactnative/core/layoutmanager/LayoutManager.js b/node_modules/recyclerlistview/dist/reactnative/core/layoutmanager/LayoutManager.js+index 9cd3c57..970421a 100644+--- a/node_modules/recyclerlistview/dist/reactnative/core/layoutmanager/LayoutManager.js++++ b/node_modules/recyclerlistview/dist/reactnative/core/layoutmanager/LayoutManager.js+@@ -111,7 +111,7 @@ var WrapGridLayoutManager = /** @class */ (function (_super) {+ var itemDim = { height: 0, width: 0 };+ var itemRect = null;+ var oldLayout = null;+- for (var i = startIndex; i < itemCount; i++) {++ for (var i = startIndex; i < Math.min(startIndex + 5000, itemCount); i++) {+ oldLayout = this._layouts[i];+ var layoutType = this._layoutProvider.getLayoutTypeForIndex(i);+ if (oldLayout && oldLayout.isOverridden && oldLayout.type === layoutType) {diff --git a/apps/mobile/share/share.js b/apps/mobile/share/share.jsindex 78985045c..dc1941d17 100644--- a/apps/mobile/share/share.js+++ b/apps/mobile/share/share.js@@ -33,7 +33,6 @@ import {SafeAreaView,ScrollView,StatusBar,- Text,TouchableOpacity,View,useWindowDimensions@@ -53,7 +52,6 @@ import Paragraph from "../app/components/ui/typography/paragraph";import { useDBItem } from "../app/hooks/use-db-item";import { eSendEvent } from "../app/services/event-manager";import { FILE_SIZE_LIMIT, IMAGE_SIZE_LIMIT } from "../app/utils/constants";-import { getElevationStyle } from "../app/utils/elevation";import { eOnLoadNote } from "../app/utils/events";import { NoteBundle } from "../app/utils/note-bundle";import { SIZE } from "../app/utils/size";