Skip to content

Commit

Permalink
Merge branch 'v4' into bulk-subscriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
yasserf committed May 5, 2019
2 parents 2ac639c + c8b6330 commit 4bb79e9
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions src/record/record-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,6 @@ export class RecordCore<Context = null> extends Emitter {
if (this.checkDestroyed('discard')) {
return
}

this.whenReadyInternal(null, () => {
this.references--
if (this.references <= 0) {
Expand Down Expand Up @@ -427,13 +426,13 @@ export class RecordCore<Context = null> extends Emitter {

public onOfflineLoading () {
this.services.storage.get(this.name, (recordName: string, version: number, data: RecordData) => {
if (this.offlineLoadingAborted) {
// This occurred since we got a connection to the server
// meaning we no longer care about current state currently
this.offlineLoadingAborted = false
return
}
if (version === -1) {
if (this.offlineLoadingAborted) {
// This occurred since we got a connection to the server
// meaning we no longer care about current state currently
this.offlineLoadingAborted = false
return
}
this.data = {}
this.version = 1
this.recordServices.dirtyService.setDirty(this.name, true)
Expand Down Expand Up @@ -764,7 +763,7 @@ export class RecordCore<Context = null> extends Emitter {
* If connected sends the delete message to server, otherwise
* we delete in local storage and transition to delete success.
*/
public sendDelete (): void {
private sendDelete (): void {
this.whenReadyInternal(null, () => {
if (this.services.connection.isConnected) {
const message = {
Expand Down Expand Up @@ -885,7 +884,6 @@ export class RecordCore<Context = null> extends Emitter {
public onConnectionLost (): void {
this.saveRecordToOffline()
}

}

const recordStateTransitions = [
Expand Down

0 comments on commit 4bb79e9

Please sign in to comment.