mirror of
https://github.com/streetwriters/notesnook.git
synced 2025-12-16 19:57:52 +01:00
Merge branch 'master' into beta
This commit is contained in:
1887
apps/web/package-lock.json
generated
1887
apps/web/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -18,7 +18,7 @@
|
||||
"@lingui/react": "5.1.2",
|
||||
"@mdi/js": "7.4.47",
|
||||
"@mdi/react": "1.6.1",
|
||||
"@notesnook-importer/core": "^2.2.2",
|
||||
"@notesnook-importer/core": "^2.2.5",
|
||||
"@notesnook/common": "file:../../packages/common",
|
||||
"@notesnook/core": "file:../../packages/core",
|
||||
"@notesnook/crypto": "file:../../packages/crypto",
|
||||
|
||||
@@ -23,11 +23,7 @@ import { useStore as useUserStore } from "./stores/user-store";
|
||||
import { useEditorStore } from "./stores/editor-store";
|
||||
import { useStore as useAnnouncementStore } from "./stores/announcement-store";
|
||||
import { useStore as useSettingStore } from "./stores/setting-store";
|
||||
import {
|
||||
resetNotices,
|
||||
scheduleBackups,
|
||||
scheduleFullBackups
|
||||
} from "./common/notices";
|
||||
import { scheduleBackups, scheduleFullBackups } from "./common/notices";
|
||||
import { introduceFeatures, resetFeatures } from "./common";
|
||||
import { AppEventManager, AppEvents } from "./common/app-events";
|
||||
import { db } from "./common/db";
|
||||
@@ -63,7 +59,7 @@ export default function AppEffects() {
|
||||
await refreshNavItems();
|
||||
await updateLastSynced();
|
||||
await initUser();
|
||||
await resetNotices();
|
||||
// await resetNotices();
|
||||
setIsVaultCreated(await db.vault.exists());
|
||||
|
||||
await FeatureDialog.show({ featureName: "highlights" });
|
||||
|
||||
@@ -89,9 +89,6 @@ export async function scheduleFullBackups() {
|
||||
export async function shouldAddAutoBackupsDisabledNotice() {
|
||||
if (isIgnored("autoBackupsOff")) return false;
|
||||
|
||||
const user = await db.user.getUser();
|
||||
if (!user) return false;
|
||||
|
||||
const backupInterval = Config.get("backupReminderOffset", 0);
|
||||
return backupInterval === 0;
|
||||
}
|
||||
@@ -201,9 +198,11 @@ function isIgnored(key: keyof typeof NoticesData) {
|
||||
|
||||
let openedToast: { hide: () => void } | null = null;
|
||||
async function saveBackup(mode: "full" | "partial" = "partial") {
|
||||
if (IS_TESTING) return;
|
||||
|
||||
if (IS_DESKTOP_APP) {
|
||||
await createBackup({ noVerify: true, mode, background: true });
|
||||
} else if (!IS_TESTING) {
|
||||
} else {
|
||||
if (openedToast !== null) return;
|
||||
openedToast = showToast(
|
||||
"success",
|
||||
|
||||
@@ -19,8 +19,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import {
|
||||
INetworkProvider,
|
||||
OneNote,
|
||||
OneNoteSettings,
|
||||
ProviderSettings,
|
||||
transform
|
||||
} from "@notesnook-importer/core";
|
||||
@@ -46,17 +44,7 @@ function getProviderSettings(
|
||||
provider: INetworkProvider<ProviderSettings>,
|
||||
settings: ProviderSettings
|
||||
) {
|
||||
if (provider instanceof OneNote) {
|
||||
return {
|
||||
...settings,
|
||||
cache: false,
|
||||
clientId: "6c32bdbd-c6c6-4cda-bcf0-0c8ec17e5804",
|
||||
redirectUri:
|
||||
process.env.NODE_ENV === "development"
|
||||
? "http://localhost:3000"
|
||||
: "https://app.notesnook.com"
|
||||
} as OneNoteSettings;
|
||||
}
|
||||
return settings;
|
||||
}
|
||||
|
||||
export function NetworkProviderHandler(props: NetworkProviderHandlerProps) {
|
||||
|
||||
@@ -29,7 +29,7 @@ import { store as reminderStore } from "./reminder-store";
|
||||
import { store as settingStore } from "./setting-store";
|
||||
import BaseStore from "./index";
|
||||
import { showToast } from "../utils/toast";
|
||||
import { Notice, resetNotices } from "../common/notices";
|
||||
import { Notice } from "../common/notices";
|
||||
import { EV, EVENTS, SYNC_CHECK_IDS, SyncOptions } from "@notesnook/core";
|
||||
import { logger } from "../utils/logger";
|
||||
import Config from "../utils/config";
|
||||
@@ -173,7 +173,7 @@ class AppStore extends BaseStore<AppStore> {
|
||||
logger.measure("refreshing app");
|
||||
|
||||
await this.updateLastSynced();
|
||||
await resetNotices();
|
||||
// await resetNotices();
|
||||
await noteStore.refresh();
|
||||
await notebookStore.refresh();
|
||||
await reminderStore.refresh();
|
||||
|
||||
@@ -38,26 +38,33 @@ export class ExportStream extends TransformStream<
|
||||
return;
|
||||
}
|
||||
if (item.type === "attachment") {
|
||||
report({ text: `Downloading attachment: ${item.path}` });
|
||||
await db
|
||||
.fs()
|
||||
.downloadFile("exports", item.data.hash, item.data.chunkSize);
|
||||
const key = await db.attachments.decryptKey(item.data.key);
|
||||
if (!key) return;
|
||||
const stream = await streamingDecryptFile(item.data.hash, {
|
||||
key,
|
||||
iv: item.data.iv,
|
||||
name: item.data.filename,
|
||||
type: item.data.mimeType,
|
||||
isUploaded: !!item.data.dateUploaded
|
||||
});
|
||||
try {
|
||||
report({ text: `Downloading attachment: ${item.path}` });
|
||||
await db
|
||||
.fs()
|
||||
.downloadFile("exports", item.data.hash, item.data.chunkSize);
|
||||
const key = await db.attachments.decryptKey(item.data.key);
|
||||
if (!key) return;
|
||||
const stream = await streamingDecryptFile(item.data.hash, {
|
||||
key,
|
||||
iv: item.data.iv,
|
||||
name: item.data.filename,
|
||||
type: item.data.mimeType,
|
||||
isUploaded: !!item.data.dateUploaded
|
||||
});
|
||||
|
||||
if (!stream) return;
|
||||
controller.enqueue({ ...item, data: stream });
|
||||
report({
|
||||
current: this.progress++,
|
||||
text: `Saving attachment: ${item.path}`
|
||||
});
|
||||
if (!stream) return;
|
||||
controller.enqueue({ ...item, data: stream });
|
||||
report({
|
||||
current: this.progress++,
|
||||
text: `Saving attachment: ${item.path}`
|
||||
});
|
||||
} catch (e) {
|
||||
if (e instanceof Error) {
|
||||
e.message = `Failed to export attachment: ${item.path}. ${e.message}`;
|
||||
handleError(e);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
controller.enqueue(item);
|
||||
report({
|
||||
|
||||
885
packages/editor/package-lock.json
generated
885
packages/editor/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -30,7 +30,7 @@
|
||||
},
|
||||
"license": "GPL-3.0-or-later",
|
||||
"dependencies": {
|
||||
"@notesnook-importer/core": "^2.2.2",
|
||||
"@notesnook-importer/core": "^2.2.5",
|
||||
"@notesnook/common": "file:../common",
|
||||
"@notesnook/intl": "file:../intl",
|
||||
"@notesnook/theme": "file:../theme",
|
||||
|
||||
Reference in New Issue
Block a user