Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix: closing modal sometimes covered by header (#2097)

Peng Xiaoab8669882ab6
diff --git a/apps/electron/layers/main/src/data/sqlite.ts b/apps/electron/layers/main/src/data/sqlite.ts
index f955878596..19b1025feb 100644
--- a/apps/electron/layers/main/src/data/sqlite.ts
+++ b/apps/electron/layers/main/src/data/sqlite.ts
@@ -36,7 +36,6 @@ interface BlobRow {
export class WorkspaceDatabase {
sqliteDB: Database;
ydoc = new Y.Doc();
- _db: Database | null = null;
ready: Promise<Uint8Array>;
@@ -59,14 +58,14 @@ export class WorkspaceDatabase {
// release resources
destroy = () => {
- this._db?.close();
+ this.sqliteDB?.close();
this.ydoc.destroy();
};
reconnectDB = () => {
logger.log('open db', this.path);
- if (this._db) {
- this._db.close();
+ if (this.sqliteDB) {
+ this.sqliteDB.close();
}
// use cached version?
const db = sqlite(this.path);
@@ -75,7 +74,7 @@ export class WorkspaceDatabase {
// logger.error('open db error', error);
// }
// });
- this._db = db;
+ this.sqliteDB = db;
db.exec(schemas.join(';'));
return db;
};
diff --git a/packages/component/src/ui/modal/styles.ts b/packages/component/src/ui/modal/styles.ts
index 7bcb078ff8..24e86b3193 100644
--- a/packages/component/src/ui/modal/styles.ts
+++ b/packages/component/src/ui/modal/styles.ts
@@ -34,6 +34,7 @@ export const StyledModal = styled(ModalUnstyled, {
left: '0',
top: '0',
zIndex: 'var(--affine-z-index-modal)',
+ WebkitAppRegion: 'no-drag',
'*': {
WebkitTapHighlightColor: 'transparent',
outline: 'none',