mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-23 23:19:40 +01:00
fix attachment loading progress
This commit is contained in:
@@ -131,7 +131,7 @@ const Editor = React.memo(
|
||||
allowUniversalAccessFromFileURLs={true}
|
||||
originWhitelist={['*']}
|
||||
source={{
|
||||
uri: __DEV__ ? 'http://192.168.10.7:3000/' : EDITOR_URI
|
||||
uri: __DEV__ ? 'http://localhost:3000/' : EDITOR_URI
|
||||
}}
|
||||
style={style}
|
||||
autoManageStatusBarEnabled={false}
|
||||
|
||||
@@ -17,6 +17,7 @@ export const ProgressBar = () => {
|
||||
|
||||
useEffect(() => {
|
||||
if (loading) {
|
||||
console.log(loading);
|
||||
if (loading.current !== loading.total) {
|
||||
setVisible(true);
|
||||
setProg(loading.current / loading.total);
|
||||
|
||||
@@ -265,7 +265,7 @@ export const useEditor = (
|
||||
useEditorStore.getState().setReadonly(item.readonly);
|
||||
loadImages();
|
||||
await commands.setTags(currentNote.current);
|
||||
await commands.setSettings();
|
||||
commands.setSettings();
|
||||
overlay(false);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -54,5 +54,5 @@ export const useAttachmentStore = create<AttachmentStore>((set, get) => ({
|
||||
encryptionProgress: 0,
|
||||
setEncryptionProgress: encryptionProgress => set({ encryptionProgress: encryptionProgress }),
|
||||
loading: { total: 0, current: 0 },
|
||||
setLoading: data => set({ loading: data })
|
||||
setLoading: data => set({ loading: data ? { ...data } : data })
|
||||
}));
|
||||
|
||||
@@ -60,6 +60,7 @@ export const useAppEvents = () => {
|
||||
});
|
||||
|
||||
const onLoadingAttachmentProgress = data => {
|
||||
console.log('loading', data);
|
||||
useAttachmentStore.getState().setLoading(data.total === data.current ? null : data);
|
||||
};
|
||||
|
||||
|
||||
@@ -14,8 +14,11 @@ type PurchaseInfo = {
|
||||
const skuInfos: { [name: string]: PurchaseInfo | undefined } = {};
|
||||
|
||||
export const usePricing = (period: 'monthly' | 'yearly') => {
|
||||
const [current, setCurrent] =
|
||||
useState<{ period: string; info?: PurchaseInfo; product?: Subscription }>();
|
||||
const [current, setCurrent] = useState<{
|
||||
period: string;
|
||||
info?: PurchaseInfo;
|
||||
product?: Subscription;
|
||||
}>();
|
||||
|
||||
const getDefaultSku = (period: 'monthly' | 'yearly') => {
|
||||
return period === 'monthly'
|
||||
|
||||
Reference in New Issue
Block a user