mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-25 14:28:51 +08:00
feat(nbstore): remove async on connection api (#9187)
We should not use async on `connect` and `disconnect`, for `WebSocketConnection` will never connect when offline. We should handle the connection status of each storage in sync, using the `connection.waitForConnect` This PR also puts the connection reference count on the `connect` and disconnect`
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import { share } from '../../connection';
|
||||
import {
|
||||
type DocClock,
|
||||
type DocClocks,
|
||||
@@ -17,7 +16,7 @@ interface ChannelMessage {
|
||||
}
|
||||
|
||||
export class IndexedDBDocStorage extends DocStorage {
|
||||
readonly connection = share(new IDBConnection(this.options));
|
||||
readonly connection = new IDBConnection(this.options);
|
||||
|
||||
get db() {
|
||||
return this.connection.inner.db;
|
||||
|
||||
Reference in New Issue
Block a user