Skip to content

Commit 25aeeed

Browse files
committed
fix(database): fix issue with missing repo method
1 parent 71e4440 commit 25aeeed

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/database/api/Database.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,7 @@ export class Database {
1717
repo_: Repo;
1818
root_: Reference;
1919
INTERNAL;
20-
private __database: Database;
21-
20+
2221
static ServerValue = {
2322
'TIMESTAMP': {
2423
'.sv' : 'timestamp'
@@ -47,10 +46,6 @@ export class Database {
4746
return this.repo_.app;
4847
}
4948

50-
get database(): Database {
51-
return this.__database || (this.__database = new Database(this));
52-
}
53-
5449
/**
5550
* Returns a reference to the root or the path specified in opt_pathString.
5651
* @param {string=} pathString
@@ -110,6 +105,12 @@ export class Database {
110105
}
111106
};
112107

108+
Object.defineProperty(Repo.prototype, 'database', {
109+
get() {
110+
return this.__database || (this.__database = new Database(this));
111+
}
112+
});
113+
113114
class DatabaseInternals {
114115
database
115116
/** @param {!Database} database */

0 commit comments

Comments
 (0)