[go: up one dir, main page]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added database for plugins #986

Merged
merged 40 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
1eaf145
test
Rider21 Mar 2, 2024
6de52a7
fix
Rider21 Mar 2, 2024
b65aed2
Update pluginManager.ts
Rider21 Mar 2, 2024
72ea4d4
test
Rider21 Mar 2, 2024
31c2b2a
fix lint
Rider21 Mar 2, 2024
ebcc953
test
Rider21 Mar 2, 2024
4cfa3df
test webview
Rider21 Mar 2, 2024
d70b760
sync
Rider21 Mar 2, 2024
23eb299
/
Rider21 Mar 2, 2024
c636056
Update WebviewScreen.tsx
Rider21 Mar 2, 2024
859c314
CookieManager
Rider21 Mar 4, 2024
1769cfd
Update storage.ts
Rider21 Mar 4, 2024
454f197
Update сookie.ts
Rider21 Mar 4, 2024
4f042cb
fix title
Rider21 Mar 4, 2024
73bd975
MarqueeText...
Rider21 Mar 4, 2024
9e8ece4
Slow
Rider21 Mar 4, 2024
3101c31
Even slower
Rider21 Mar 4, 2024
015faaf
Merge remote-tracking branch 'upstream/master' into db
Rider21 Mar 5, 2024
59c1866
Squashed commit of the following:
Rider21 Mar 8, 2024
8a51a81
Merge remote-tracking branch 'upstream/master' into db
Rider21 Mar 8, 2024
64ce651
fix
Rider21 Mar 8, 2024
7ae8e53
Merge remote-tracking branch 'upstream/master' into db
Rider21 Mar 11, 2024
d5db2fd
fix
Rider21 Mar 11, 2024
a67e208
Update pluginManager.ts
Rider21 Mar 19, 2024
d7c79b2
Merge branch 'master' into db
Rider21 Mar 27, 2024
e65d43f
Merge remote-tracking branch 'upstream/master' into db
Rider21 Mar 27, 2024
320958a
test
Rider21 Mar 27, 2024
00aa7ef
fix
Rider21 Mar 29, 2024
4ea331f
fix lint
Rider21 Mar 30, 2024
8404f66
-marquee
Rider21 Apr 2, 2024
2b2bed0
Merge remote-tracking branch 'upstream/master' into db
Rider21 Apr 7, 2024
b0202c5
fix defaultCover
Rider21 Apr 7, 2024
c35d39c
Merge remote-tracking branch 'upstream/master' into db
Rider21 Apr 26, 2024
0b86a1c
test
Rider21 Apr 27, 2024
936e6f7
Merge remote-tracking branch 'upstream/master' into db
Rider21 Apr 27, 2024
9aa0649
Merge remote-tracking branch 'upstream/master' into db
Rider21 May 4, 2024
8166260
Update src/plugins/helpers/storage.ts
Rider21 May 8, 2024
497f8cb
test
Rider21 May 10, 2024
2daab50
Typescript fixes
nyagami May 22, 2024
89a1b72
private pluginID
nyagami May 22, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix
  • Loading branch information
Rider21 committed Mar 11, 2024
commit d5db2fd0c2d7a8b45cce602df32e27419cccfaf0
107 changes: 72 additions & 35 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"expo-web-browser": "~12.3.2",
"i18n-js": "^3.8.0",
"lodash-es": "^4.17.21",
"qs": "^6.11.2",
"qs": "^6.12.0",
"react": "18.2.0",
"react-native": "0.72.10",
"react-native-background-actions": "^3.0.1",
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/pluginManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ const updatePlugin = async (plugin: PluginItem) => {

const fetchPlugins = (): Promise<Record<Language, Array<PluginItem>>> => {
// plugins host
const githubUsername = 'Rider21';
const githubUsername = 'LNReader';
const githubRepository = 'lnreader-sources';

return fetch(
Expand Down
1 change: 1 addition & 0 deletions src/plugins/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,5 @@ export interface Plugin extends PluginItem {
searchNovels: (searchTerm: string, pageNo: number) => Promise<NovelItem[]>;
fetchImage: (url: string) => Promise<string>;
resolveUrl?: (path: string, isNovel?: boolean) => string;
webStorageUtilized?: boolean;
}
7 changes: 5 additions & 2 deletions src/screens/WebviewScreen/WebviewScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import React, { useRef, useState } from 'react';
import WebView, { WebViewNavigation } from 'react-native-webview';
import { ProgressBar } from 'react-native-paper';

import { getPlugin } from '@plugins/pluginManager';
import { useBackHandler } from '@hooks';
import { useTheme } from '@hooks/persisted';
import { WebviewScreenProps } from '@navigators/types';
Expand All @@ -18,6 +19,7 @@ type StorageData = {

const WebviewScreen = ({ route, navigation }: WebviewScreenProps) => {
const { name, url, pluginId, isNovel } = route.params;
const isSave = getPlugin(pluginId)?.webStorageUtilized;
const uri = resolveUrl(pluginId, url, isNovel);

const theme = useTheme();
Expand All @@ -43,7 +45,7 @@ const WebviewScreen = ({ route, navigation }: WebviewScreenProps) => {
};

const saveData = () => {
if (pluginId && tempData) {
if (pluginId && tempData && isSave) {
storage.mmkv.set(
pluginId + '_LocalStorage',
JSON.stringify(tempData?.localStorage || {}),
Expand All @@ -59,7 +61,8 @@ const WebviewScreen = ({ route, navigation }: WebviewScreenProps) => {
if (menuVisible) {
setMenuVisible(false);
return true;
} else if (canGoBack) {
}
if (canGoBack) {
webViewRef.current?.goBack();
return true;
}
Expand Down
5 changes: 2 additions & 3 deletions src/screens/WebviewScreen/components/Menu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ const Menu: React.FC<MenuProps> = ({
webView,
setMenuVisible,
}) => {
const insets = useSafeAreaInsets();
const { top } = useSafeAreaInsets();

return (
<Pressable => setMenuVisible(false)} style={styles.container}>
<View style={[styles.menuContainer, { top: insets.top }]}>
<View style={[styles.menuContainer, { top }]}>
<Pressable
style={[styles.menuButton, { backgroundColor: theme.surface2 }]}
=> {
Expand Down Expand Up @@ -98,6 +98,5 @@ const styles = StyleSheet.create({
},
menuButton: {
padding: 15,
marginVertical: 5,
},
});
Loading