mobile: fix share extension in release

This commit is contained in:
Ammar Ahmed
2023-12-04 12:32:35 +05:00
parent dad1742e80
commit 356142bb22
13 changed files with 68 additions and 53 deletions

View File

@@ -628,7 +628,7 @@ export const useAppEvents = () => {
if (!db.isInitialized) {
await db.init();
}
initialize();
await initialize();
useNoteStore.getState().setLoading(false);
},
disableClosing: true
@@ -656,8 +656,10 @@ export const useAppEvents = () => {
}
}
if (IsDatabaseMigrationRequired()) return;
initialize();
useNoteStore.getState().setLoading(false);
await initialize();
setImmediate(() => {
useNoteStore.getState().setLoading(false);
});
Walkthrough.init();
}, [IsDatabaseMigrationRequired]);

View File

@@ -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.Navigator
tabBar={() => null}
initialRouteName={!introCompleted ? "Welcome" : homepage}

View File

@@ -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() {

View File

@@ -16,8 +16,6 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along 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;

View File

@@ -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} />

View File

@@ -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>

View File

@@ -19,6 +19,9 @@
6510E6D72877215700DACAA9 /* build.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 6510E6D62877215700DACAA9 /* build.bundle */; };
6515C42F2580AA3000E83E39 /* StoreKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 6515C42E2580AA2F00E83E39 /* StoreKit.framework */; };
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 */; };
659670B22A2754FD00C5D2AF /* OpenSans-Bold.ttf in Resources */ = {isa = PBXBuildFile; fileRef = 659670B12A2754FD00C5D2AF /* OpenSans-Bold.ttf */; };
659BE46725E11A5100E05671 /* notesnook-text.png in Resources */ = {isa = PBXBuildFile; fileRef = 659BE46625E11A5100E05671 /* notesnook-text.png */; };
@@ -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 */,
@@ -1100,11 +1106,9 @@
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_ENTITLEMENTS = Notesnook/Notesnook.entitlements;
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Distribution";
CODE_SIGN_STYLE = Manual;
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2063;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 53CWBG3QUC;
DEVELOPMENT_TEAM = 53CWBG3QUC;
"EXCLUDED_ARCHS[sdk=iphonesimulator*]" = arm64;
GCC_GENERATE_DEBUGGING_SYMBOLS = YES;
HEADER_SEARCH_PATHS = (
@@ -1186,7 +1190,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 +1378,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 = 2063;
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 +1397,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 +1523,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 = 2063;
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 +1604,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;

View File

@@ -71,6 +71,11 @@
debugServiceExtension = "internal"
allowLocationSimulation = "YES"
launchAutomaticallySubstyle = "2">
<RemoteRunnable
runnableDebuggingMode = "1"
BundleIdentifier = "com.apple.mobilesafari"
RemotePath = "/Applications/MobileSafari.app">
</RemoteRunnable>
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"

View File

@@ -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>

View File

@@ -95,6 +95,9 @@ target 'Make Note' do
pod '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'
end

View File

@@ -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: da78c828fe1bcbb92d8b505d5261890ed315ff39
react-native-orientation: f1caf84d65f1a4fd4511a18f2b924e634ad7a628
react-native-pdf: 33c622cbdf776a649929e8b9d1ce2d313347c4fa
react-native-quick-sqlite: e0e23b749382a85e4b57146f753de737a6c3a9e1
react-native-safe-area-context: 36cc67648134e89465663b8172336a19eeda493d
react-native-share-extension: df66a2ee48a62277d79898375e2142bde0782063
react-native-sodium: 955bb0dc3ea05f8ea06d5e96cb89d1be7b5d7681
@@ -929,6 +937,6 @@ SPEC CHECKSUMS:
toolbar-android: 2a73856e98b750d7e71ce4644d3f41cc98211719
Yoga: 1d6727ed193122f6adaf435c3de1a768326ff83b
PODFILE CHECKSUM: b0cadd188aa428b98d1eaa0b84b3b6208e714119
PODFILE CHECKSUM: 21553b7e17c48c3fa8e56d4cc26e0c4bd4a74260
COCOAPODS: 1.12.1

View File

@@ -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) {

View File

@@ -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";