File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
packages/web/src/db/adapters Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change @@ -55,15 +55,15 @@ export class WorkerWrappedAsyncDatabaseConnection<Config extends ResolvedWebSQLO
5555 * This lock will be held as long as this connection is open.
5656 * The `shareConnection` method should not be called on multiple tabs concurrently.
5757 */
58- await new Promise < void > ( ( lockObtained , reject ) =>
58+ await new Promise < void > ( ( resolve , reject ) =>
5959 navigator . locks
6060 . request (
6161 `shared-connection-${ this . options . identifier } ` ,
6262 {
6363 signal : this . lockAbortController . signal
6464 } ,
6565 async ( ) => {
66- lockObtained ( ) ;
66+ resolve ( ) ;
6767
6868 // Free the lock when the connection is already closed.
6969 if ( this . lockAbortController . signal . aborted ) {
@@ -80,7 +80,9 @@ export class WorkerWrappedAsyncDatabaseConnection<Config extends ResolvedWebSQLO
8080 )
8181 // We aren't concerned with abort errors here
8282 . catch ( ( ex ) => {
83- if ( ex . name != 'AbortError' ) {
83+ if ( ex . name == 'AbortError' ) {
84+ resolve ( ) ;
85+ } else {
8486 reject ( ex ) ;
8587 }
8688 } )
You can’t perform that action at this time.
0 commit comments