change userRecord.data to userRecord.data() (#114)

* change userRecord.data to userRecord.data() because userRecord.data is always not null.

* on my windows 10, notificationHandler and getFeed can be accessed by adding /lib/ folder.
This commit is contained in:
Chang W. Lee
2021-03-23 22:56:06 +09:00
committed by GitHub
parent 97c31603fc
commit bb86faa9b1
2 changed files with 3 additions and 3 deletions

View File

@@ -10,8 +10,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
Object.defineProperty(exports, "__esModule", { value: true });
const functions = require("firebase-functions");
const admin = require("firebase-admin");
const notificationHandler_1 = require("./notificationHandler");
const getFeed_1 = require("./getFeed");
const notificationHandler_1 = require("./lib/notificationHandler");
const getFeed_1 = require("./lib/getFeed");
admin.initializeApp();
exports.notificationHandler = functions.firestore.document("/insta_a_feed/{userId}/items/{activityFeedItem}")
.onCreate((snapshot, context) => __awaiter(this, void 0, void 0, function* () {

View File

@@ -100,7 +100,7 @@ Future<void> tryCreateUserRecord(BuildContext context) async {
return null;
}
DocumentSnapshot userRecord = await ref.doc(user.id).get();
if (userRecord.data == null) {
if (userRecord.data() == null) {
// no user record exists, time to create
String userName = await Navigator.push(