Skip to content

Commit 5378f62

Browse files
committed
Small fix for child()
1 parent 4f534cb commit 5378f62

File tree

2 files changed

+20
-21
lines changed

2 files changed

+20
-21
lines changed

ios/Firestack/Firestack.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ @implementation Firestack
7575
}
7676

7777
if (![opts valueForKey:@"androidClientID"] && [opts valueForKey:@"clientID"]) {
78-
[props setValue[opts valueForKey:@"clientID"] forKey:@"androidClientID"];
78+
[props setValue:[opts valueForKey:@"clientID"] forKey:@"androidClientID"];
7979
}
8080

8181
@try {

lib/modules/database.js

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,8 @@ class DatabaseRef {
8686
return new DatabaseRef(this.db, []);
8787
}
8888

89-
child(...paths) {
90-
this.path = this.path.concat(paths);
91-
return this;
89+
child(...paths) {;
90+
return new DatabaseRef(this.db, this.path.concat(paths));
9291
}
9392

9493
// Get the value of a ref either with a key
@@ -99,13 +98,13 @@ class DatabaseRef {
9998
}
10099

101100
setAt(key, val) {
102-
const {path, value} = this.dbPath([key, val]);
103-
return promisify('set', FirestackDatabase)(path, value)
101+
const {path} = this.dbPath([key, val]);
102+
return promisify('set', FirestackDatabase)(path, val)
104103
}
105104

106-
updateAt(key, val) {
107-
const {path, value} = this.dbPath([key, val]);
108-
return promisify('update', FirestackDatabase)(path, value)
105+
updateAt(val) {
106+
const {path} = this.dbPath([val]);
107+
return promisify('update', FirestackDatabase)(path, val)
109108
}
110109

111110
removeAt(key) {
@@ -227,18 +226,18 @@ class DatabaseRef {
227226
if (arr && arr.length > 0) {
228227
key = arr[0];
229228
value = arr[1];
230-
// A key and a value were passed, to parse, if necessary
231-
if (arr.length == 1) {
232-
if (key && typeof(key) == 'string') {
233-
path.push(key);
234-
}
235-
} else {
236-
if (key && typeof(key) == 'string' && value) {
237-
path.push(key);
238-
} else {
239-
value = key;
240-
}
241-
}
229+
// // A key and a value were passed, to parse, if necessary
230+
// if (arr.length == 1) {
231+
// if (key && typeof(key) == 'string') {
232+
// path.push(key);
233+
// }
234+
// } else {
235+
// if (key && typeof(key) == 'string' && value) {
236+
// path.push(key);
237+
// } else {
238+
// value = key;
239+
// }
240+
// }
242241
}
243242

244243
let pathStr = (path.length > 0 ? path.join('/') : '/');

0 commit comments

Comments
 (0)